netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] enetc: enetc_pci_mdio: Fix inconsistent IS_ERR and PTR_ERR
@ 2020-01-08  6:21 Gustavo A. R. Silva
  2020-01-08  8:45 ` Vladimir Oltean
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2020-01-08  6:21 UTC (permalink / raw)
  To: Claudiu Manoil, David S. Miller, Vladimir Oltean
  Cc: netdev, linux-kernel, Gustavo A. R. Silva

Fix inconsistent IS_ERR and PTR_ERR in enetc_pci_mdio_probe().

The proper pointer to be passed as argument is hw.

This bug was detected with the help of Coccinelle.

Fixes: 6517798dd343 ("enetc: Make MDIO accessors more generic and export to include/linux/fsl")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c b/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
index 87c0e969da40..ebc635f8a4cc 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
@@ -27,7 +27,7 @@ static int enetc_pci_mdio_probe(struct pci_dev *pdev,
 	}
 
 	hw = enetc_hw_alloc(dev, port_regs);
-	if (IS_ERR(enetc_hw_alloc)) {
+	if (IS_ERR(hw)) {
 		err = PTR_ERR(hw);
 		goto err_hw_alloc;
 	}
-- 
2.23.0


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

* Re: [PATCH net-next] enetc: enetc_pci_mdio: Fix inconsistent IS_ERR and PTR_ERR
  2020-01-08  6:21 [PATCH net-next] enetc: enetc_pci_mdio: Fix inconsistent IS_ERR and PTR_ERR Gustavo A. R. Silva
@ 2020-01-08  8:45 ` Vladimir Oltean
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir Oltean @ 2020-01-08  8:45 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Claudiu Manoil, David S. Miller, Vladimir Oltean, netdev, lkml

Hi Gustavo,

On Wed, 8 Jan 2020 at 08:41, Gustavo A. R. Silva <gustavo@embeddedor.com> wrote:
>
> Fix inconsistent IS_ERR and PTR_ERR in enetc_pci_mdio_probe().
>
> The proper pointer to be passed as argument is hw.
>
> This bug was detected with the help of Coccinelle.
>
> Fixes: 6517798dd343 ("enetc: Make MDIO accessors more generic and export to include/linux/fsl")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---

This was fixed yesterday:

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=4addbcb387c9519b320a9411cad68f0c01e9ed4b

>  drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c b/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
> index 87c0e969da40..ebc635f8a4cc 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
> @@ -27,7 +27,7 @@ static int enetc_pci_mdio_probe(struct pci_dev *pdev,
>         }
>
>         hw = enetc_hw_alloc(dev, port_regs);
> -       if (IS_ERR(enetc_hw_alloc)) {
> +       if (IS_ERR(hw)) {
>                 err = PTR_ERR(hw);
>                 goto err_hw_alloc;
>         }
> --
> 2.23.0
>

Thanks,
-Vladimir

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

end of thread, other threads:[~2020-01-08  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08  6:21 [PATCH net-next] enetc: enetc_pci_mdio: Fix inconsistent IS_ERR and PTR_ERR Gustavo A. R. Silva
2020-01-08  8:45 ` Vladimir Oltean

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