lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220109123141.5hq5osei3v5ebbo2@luna>
Date:   Sun, 9 Jan 2022 13:31:41 +0100
From:   Emmanuel Gil Peyrot <linkmauve@...kmauve.fr>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Alessandro Zummo <a.zummo@...ertech.it>,
        Emmanuel Gil Peyrot <linkmauve@...kmauve.fr>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] rtc: gamecube: Fix an IS_ERR() vs NULL check

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@...kmauve.fr>

> 
> Fixes: 86559400b3ef ("rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.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

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ