linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] watchdog: sunxi_wdt: fix improper error exit code
@ 2020-05-29  9:45 Frank Lee
  2020-05-29 11:08 ` Maxime Ripard
  2020-05-29 16:51 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Frank Lee @ 2020-05-29  9:45 UTC (permalink / raw)
  To: wim, linux, mripard, wens
  Cc: linux-watchdog, linux-arm-kernel, linux-kernel, wuyan,
	tiny.windzz, Frank Lee

From: Martin Wu <wuyan@allwinnertech.com>

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>
---
 drivers/watchdog/sunxi_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/sunxi_wdt.c b/drivers/watchdog/sunxi_wdt.c
index 5f05a45ac187..b50757882a98 100644
--- a/drivers/watchdog/sunxi_wdt.c
+++ b/drivers/watchdog/sunxi_wdt.c
@@ -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)
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-29 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29  9:45 [PATCH] watchdog: sunxi_wdt: fix improper error exit code Frank Lee
2020-05-29 11:08 ` Maxime Ripard
2020-05-29 16:51 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).