summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Fedin <p.fedin@samsung.com>2015-11-12 14:55:18 +0300
committerDavid S. Miller <davem@davemloft.net>2015-11-16 02:30:00 +0300
commit5883d9c6d7e680bcdc7a8a9ed2509cd10dd98206 (patch)
tree5ee8e0a2dafd07803119989080a2edcaba56e3c9
parented5a377d87dc4c87fb3e1f7f698cba38cd893103 (diff)
downloadlinux-5883d9c6d7e680bcdc7a8a9ed2509cd10dd98206.tar.xz
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: Pavel Fedin <p.fedin@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/cavium/thunder/nicvf_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
index a9377727c11c..372c39e5bcbd 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@ -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);
}