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

* Re: [PATCH] watchdog: sunxi_wdt: fix improper error exit code
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2020-05-29 11:08 UTC (permalink / raw)
  To: Frank Lee
  Cc: wim, linux, wens, linux-watchdog, linux-arm-kernel, linux-kernel,
	wuyan, tiny.windzz

[-- Attachment #1: Type: text/plain, Size: 358 bytes --]

On Fri, May 29, 2020 at 05:45:14PM +0800, Frank Lee wrote:
> 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>

Acked-by: Maxime Ripard <mripard@kernel.org>

Thanks!
Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH] watchdog: sunxi_wdt: fix improper error exit code
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2020-05-29 16:51 UTC (permalink / raw)
  To: Frank Lee
  Cc: wim, mripard, wens, linux-watchdog, linux-arm-kernel,
	linux-kernel, wuyan, tiny.windzz

On Fri, May 29, 2020 at 05:45:14PM +0800, Frank Lee wrote:
> 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>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  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	[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).