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: <20211203125350.nvghzibkbl6gdewp@soft-dev3-1.localhost>
Date:   Fri, 3 Dec 2021 13:53:50 +0100
From:   Horatiu Vultur <horatiu.vultur@...rochip.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
CC:     <UNGLinuxDriver@...rochip.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, <netdev@...r.kernel.org>,
        <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH net-next] net: lan966x: fix a IS_ERR() vs NULL check in
 lan966x_create_targets()

The 12/03/2021 12:55, Dan Carpenter wrote:
> 
> The devm_ioremap() function does not return error pointers.  It returns
> NULL.

Reviewed-by: Horatiu Vultur <horatiu.vultur@...rochip.com>
> 
> Fixes: db8bcaad5393 ("net: lan966x: add the basic lan966x driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
> ---
>  drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> index e9e4dca6542d..00930d81521a 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> @@ -83,10 +83,10 @@ static int lan966x_create_targets(struct platform_device *pdev,
>                 begin[idx] = devm_ioremap(&pdev->dev,
>                                           iores[idx]->start,
>                                           resource_size(iores[idx]));
> -               if (IS_ERR(begin[idx])) {
> +               if (!begin[idx]) {
>                         dev_err(&pdev->dev, "Unable to get registers: %s\n",
>                                 iores[idx]->name);
> -                       return PTR_ERR(begin[idx]);
> +                       return -ENOMEM;
>                 }
>         }
> 
> --
> 2.20.1
> 

-- 
/Horatiu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ