From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alessandro Zummo <a.zummo@towertech.it>,
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
Michael Ellerman <mpe@ellerman.id.au>,
linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] rtc: gamecube: Fix an IS_ERR() vs NULL check
Date: Fri, 7 Jan 2022 10:33:40 +0300 [thread overview]
Message-ID: <20220107073340.GF22086@kili> (raw)
The devm_kzalloc() function returns NULL on error, it doesn't return
error pointers.
Fixes: 86559400b3ef ("rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/rtc/rtc-gamecube.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-gamecube.c b/drivers/rtc/rtc-gamecube.c
index 98128746171e..f717b36f4738 100644
--- a/drivers/rtc/rtc-gamecube.c
+++ b/drivers/rtc/rtc-gamecube.c
@@ -319,8 +319,8 @@ static int gamecube_rtc_probe(struct platform_device *pdev)
int ret;
d = devm_kzalloc(dev, sizeof(struct priv), GFP_KERNEL);
- if (IS_ERR(d))
- return PTR_ERR(d);
+ if (!d)
+ return -ENOMEM;
d->iob = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(d->iob))
--
2.20.1
next reply other threads:[~2022-01-07 7:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-07 7:33 Dan Carpenter [this message]
2022-01-09 12:31 ` [PATCH] rtc: gamecube: Fix an IS_ERR() vs NULL check Emmanuel Gil Peyrot
2022-01-16 22:36 ` Alexandre Belloni
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=20220107073340.GF22086@kili \
--to=dan.carpenter@oracle.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linkmauve@linkmauve.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=mpe@ellerman.id.au \
/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).