All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: lan966x: fix a IS_ERR() vs NULL check in lan966x_create_targets()
@ 2021-12-03  9:55 Dan Carpenter
  2021-12-03 12:53 ` Horatiu Vultur
  2021-12-03 14:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-12-03  9:55 UTC (permalink / raw)
  To: Horatiu Vultur
  Cc: UNGLinuxDriver, David S. Miller, Jakub Kicinski, netdev, kernel-janitors

The devm_ioremap() function does not return error pointers.  It returns
NULL.

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: lan966x: fix a IS_ERR() vs NULL check in lan966x_create_targets()
  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
  2021-12-03 14:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Horatiu Vultur @ 2021-12-03 12:53 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: UNGLinuxDriver, David S. Miller, Jakub Kicinski, netdev, kernel-janitors

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: lan966x: fix a IS_ERR() vs NULL check in lan966x_create_targets()
  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
@ 2021-12-03 14:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-12-03 14:30 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: horatiu.vultur, UNGLinuxDriver, davem, kuba, netdev, kernel-janitors

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri, 3 Dec 2021 12:55:31 +0300 you wrote:
> The devm_ioremap() function does not return error pointers.  It returns
> NULL.
> 
> 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(-)

Here is the summary with links:
  - [net-next] net: lan966x: fix a IS_ERR() vs NULL check in lan966x_create_targets()
    https://git.kernel.org/netdev/net-next/c/bb14bfc7eb92

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-03 14:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-12-03 14:30 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.