Skip to content

Commit

Permalink
r8169: remove netif_napi_del in probe error path
Browse files Browse the repository at this point in the history
netif_napi_del is called implicitely by free_netdev, therefore we
don't have to do it explicitely.

When the probe error path is reached, the net_device isn't
registered yet. Therefore reordering the call to netif_napi_del
shouldn't cause any issues.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed Dec 13, 2017
1 parent 4c45d24 commit 4cf964a
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions drivers/net/ethernet/realtek/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -8672,14 +8672,12 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
tp->counters = dmam_alloc_coherent (&pdev->dev, sizeof(*tp->counters),
&tp->counters_phys_addr,
GFP_KERNEL);
if (!tp->counters) {
rc = -ENOMEM;
goto err_out_msi_5;
}
if (!tp->counters)
return -ENOMEM;

rc = register_netdev(dev);
if (rc < 0)
goto err_out_msi_5;
return rc;

pci_set_drvdata(pdev, dev);

Expand Down Expand Up @@ -8709,11 +8707,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
netif_carrier_off(dev);

return 0;

err_out_msi_5:
netif_napi_del(&tp->napi);

return rc;
}

static struct pci_driver rtl8169_pci_driver = {
Expand Down

0 comments on commit 4cf964a

Please sign in to comment.