Skip to contentSkip to conversation

watchdog: sunxi_wdt: fix improper error exit code

PATCH In review Frank Lee 3 participants 3 messages May 29, 2020

Subsystems (2)
lore
Share & tools
lore

Frank Lee

author
#0 lore raw

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.

---
 drivers/watchdog/sunxi_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/sunxi_wdt.c +1 -1
index 5f05a45ac187..b50757882a98 100644
@@ -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
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Frank Lee
Quoted 6 lines · Frank Lee

From: Martin Wu <[email protected]>

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

Quoted 20 lines
---
 drivers/watchdog/sunxi_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/sunxi_wdt.c +1 -1
index 5f05a45ac187..b50757882a98 100644
@@ -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