Commit 5883d9c6 authored by Pavel Fedin's avatar Pavel Fedin Committed by David S. Miller

net: thunder: Fix crash upon shutdown after failed probe

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: default avatarPavel Fedin <p.fedin@samsung.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ed5a377d
...@@ -1600,6 +1600,9 @@ static void nicvf_remove(struct pci_dev *pdev) ...@@ -1600,6 +1600,9 @@ static void nicvf_remove(struct pci_dev *pdev)
static void nicvf_shutdown(struct pci_dev *pdev) static void nicvf_shutdown(struct pci_dev *pdev)
{ {
if (!pci_get_drvdata(pdev))
return;
nicvf_remove(pdev); nicvf_remove(pdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment