watchdog: sunxi_wdt: fix improper error exit code
Subsystems (2)
PATCH 1/1 watchdog: sunxi_wdt: fix improper error exit code
From: Martin Wu <[email protected]>
sunxi_wdt_probe() should return -ENOMEM when devm_kzalloc() fails.
Signed-off-by Martin Wu <[email protected]>
Signed-off-by Frank Lee <[email protected]>
--- drivers/watchdog/sunxi_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/sunxi_wdt.c +1 -1
@@ -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)
Signature · 1 line
2.24.0
Quoted 6 lines · Frank Lee
From: Martin Wu <[email protected]>
sunxi_wdt_probe()should return-ENOMEMwhendevm_kzalloc()fails.Signed-off-by Martin Wu <[email protected]>Signed-off-by Frank Lee <[email protected]>
Acked-by Maxime Ripard <[email protected]>
Thanks!
Maxime
Quoted 6 lines · Frank Lee
From: Martin Wu <[email protected]>
sunxi_wdt_probe()should return-ENOMEMwhendevm_kzalloc()fails.Signed-off-by Martin Wu <[email protected]>Signed-off-by Frank Lee <[email protected]>
Reviewed-by Guenter Roeck <[email protected]>
Quoted 20 lines
--- drivers/watchdog/sunxi_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/watchdog/sunxi_wdt.c +1
-1@@ -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)Signature · 1 line
2.24.0