Skip to contentSkip to conversation

enetc: enetc_pci_mdio: Fix inconsistent IS_ERR and PTR_ERR

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Jan 8, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 enetc: enetc_pci_mdio: Fix inconsistent IS_ERR and PTR_ERR

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")
---
 drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c +1 -1
index 87c0e969da40..ebc635f8a4cc 100644
@@ -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;
 	}
Signature · 1 line
2.23.0
#1 lore raw

Hi Gustavo,

Quoted 10 lines · 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")

---

This was fixed yesterday:

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

Quoted 17 lines
 drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c +1 -2
index 87c0e969da40..ebc635f8a4cc 100644
@@ -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;
        }
--
Quoted 2 lines

2.23.0

Thanks,
-Vladimir