Message ID | 20231129082720.656172-1-yangyingliang@huaweicloud.com (mailing list archive) |
---|---|
State | Handled Elsewhere, archived |
Headers | show |
Series | soc: loongson2_pm: fix wrong pointer check in loongson2_power_button_init() | expand |
diff --git a/drivers/soc/loongson/loongson2_pm.c b/drivers/soc/loongson/loongson2_pm.c index b8e5e1e3528a..76181330696b 100644 --- a/drivers/soc/loongson/loongson2_pm.c +++ b/drivers/soc/loongson/loongson2_pm.c @@ -100,7 +100,7 @@ static int loongson2_power_button_init(struct device *dev, int irq) struct input_dev *button; button = input_allocate_device(); - if (!dev) + if (!button) return -ENOMEM; button->name = "Power Button";