From: Frank Lee <frank@allwinnertech.com>
To: wim@linux-watchdog.org, linux@roeck-us.net, mripard@kernel.org,
wens@csie.org
Cc: linux-watchdog@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, wuyan@allwinnertech.com,
tiny.windzz@gmail.com, Frank Lee <frank@allwinnertech.com>
Subject: [PATCH] watchdog: sunxi_wdt: fix improper error exit code
Date: Fri, 29 May 2020 17:45:14 +0800 [thread overview]
Message-ID: <20200529094514.26374-1-frank@allwinnertech.com> (raw)
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
next reply other threads:[~2020-05-29 9:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-29 9:45 Frank Lee [this message]
2020-05-29 11:08 ` [PATCH] watchdog: sunxi_wdt: fix improper error exit code Maxime Ripard
2020-05-29 16:51 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200529094514.26374-1-frank@allwinnertech.com \
--to=frank@allwinnertech.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mripard@kernel.org \
--cc=tiny.windzz@gmail.com \
--cc=wens@csie.org \
--cc=wim@linux-watchdog.org \
--cc=wuyan@allwinnertech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).