linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>,
	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: Re: [PATCH] rtc: gamecube: Fix an IS_ERR() vs NULL check
Date: Sun, 9 Jan 2022 13:31:41 +0100	[thread overview]
Message-ID: <20220109123141.5hq5osei3v5ebbo2@luna> (raw)
In-Reply-To: <20220107073340.GF22086@kili>

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

On Fri, Jan 07, 2022 at 10:33:40AM +0300, Dan Carpenter wrote:
> The devm_kzalloc() function returns NULL on error, it doesn't return
> error pointers.

Good catch, thanks!

Reviewed-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>

> 
> 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

-- 
Emmanuel Gil Peyrot

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

  reply	other threads:[~2022-01-09 12:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07  7:33 [PATCH] rtc: gamecube: Fix an IS_ERR() vs NULL check Dan Carpenter
2022-01-09 12:31 ` Emmanuel Gil Peyrot [this message]
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=20220109123141.5hq5osei3v5ebbo2@luna \
    --to=linkmauve@linkmauve.fr \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --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).