Commit ff01cb1c authored by Martin Wu's avatar Martin Wu Committed by Wim Van Sebroeck
Browse files

watchdog: sunxi_wdt: fix improper error exit code



sunxi_wdt_probe() should return -ENOMEM when devm_kzalloc() fails.

Signed-off-by: default avatarMartin Wu <wuyan@allwinnertech.com>
Signed-off-by: default avatarFrank Lee <frank@allwinnertech.com>
Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200529094514.26374-1-frank@allwinnertech.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 0be01476
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -235,7 +235,7 @@ static int sunxi_wdt_probe(struct platform_device *pdev)

	sunxi_wdt = devm_kzalloc(dev, sizeof(*sunxi_wdt), GFP_KERNEL);
	if (!sunxi_wdt)
		return -EINVAL;
		return -ENOMEM;

	sunxi_wdt->wdt_regs = of_device_get_match_data(dev);
	if (!sunxi_wdt->wdt_regs)