Skip to content

Commit

Permalink
net: thunder: Fix crash upon shutdown after failed probe
Browse files Browse the repository at this point in the history
If device probe fails, driver remains bound to the PCI device. However,
driver data has been reset to NULL. This causes crash upon dereferencing
it in nicvf_remove()

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Fedin authored and David S. Miller committed Nov 15, 2015
1 parent ed5a377 commit 5883d9c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/cavium/thunder/nicvf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,9 @@ static void nicvf_remove(struct pci_dev *pdev)

static void nicvf_shutdown(struct pci_dev *pdev)
{
if (!pci_get_drvdata(pdev))
return;

nicvf_remove(pdev);
}

Expand Down

0 comments on commit 5883d9c

Please sign in to comment.