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

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.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 0be01476
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment