diff options
author | Pavel Fedin <p.fedin@samsung.com> | 2015-11-12 14:55:18 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-11-15 18:30:00 -0500 |
commit | 5883d9c6d7e680bcdc7a8a9ed2509cd10dd98206 (patch) | |
tree | 5ee8e0a2dafd07803119989080a2edcaba56e3c9 | |
parent | ed5a377d87dc4c87fb3e1f7f698cba38cd893103 (diff) | |
download | blackbird-op-linux-5883d9c6d7e680bcdc7a8a9ed2509cd10dd98206.tar.gz blackbird-op-linux-5883d9c6d7e680bcdc7a8a9ed2509cd10dd98206.zip |
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.c | 3 |
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); } |