watchdog: sunxi_wdt: fix improper error exit code

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

Signed-off-by: Martin Wu <wuyan@allwinnertech.com>
Signed-off-by: Frank Lee <frank@allwinnertech.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200529094514.26374-1-frank@allwinnertech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
This commit is contained in:
Martin Wu 2020-05-29 17:45:14 +08:00 committed by Wim Van Sebroeck
parent 0be01476dd
commit ff01cb1ca1

View File

@ -235,7 +235,7 @@ static int sunxi_wdt_probe(struct platform_device *pdev)
sunxi_wdt = devm_kzalloc(dev, sizeof(*sunxi_wdt), GFP_KERNEL); sunxi_wdt = devm_kzalloc(dev, sizeof(*sunxi_wdt), GFP_KERNEL);
if (!sunxi_wdt) if (!sunxi_wdt)
return -EINVAL; return -ENOMEM;
sunxi_wdt->wdt_regs = of_device_get_match_data(dev); sunxi_wdt->wdt_regs = of_device_get_match_data(dev);
if (!sunxi_wdt->wdt_regs) if (!sunxi_wdt->wdt_regs)