public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <UNGLinuxDriver@microchip.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, <netdev@vger.kernel.org>,
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH net-next] net: lan966x: fix a IS_ERR() vs NULL check in lan966x_create_targets()
Date: Fri, 3 Dec 2021 13:53:50 +0100	[thread overview]
Message-ID: <20211203125350.nvghzibkbl6gdewp@soft-dev3-1.localhost> (raw)
In-Reply-To: <20211203095531.GB2480@kili>

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@microchip.com>
> 
> Fixes: db8bcaad5393 ("net: lan966x: add the basic lan966x driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.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

  reply	other threads:[~2021-12-03 12:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03  9:55 [PATCH net-next] net: lan966x: fix a IS_ERR() vs NULL check in lan966x_create_targets() Dan Carpenter
2021-12-03 12:53 ` Horatiu Vultur [this message]
2021-12-03 14:30 ` patchwork-bot+netdevbpf

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=20211203125350.nvghzibkbl6gdewp@soft-dev3-1.localhost \
    --to=horatiu.vultur@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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