net: thunder: Fix crash upon shutdown after failed probe
[firefly-linux-kernel-4.4.55.git] / drivers / net / ethernet / cavium / thunder / nicvf_main.c
index a9377727c11c3fdb18a09f16ce8366ae4ef48057..372c39e5bcbd88860bcd09c7d16471d91e654119 100644 (file)
@@ -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);
 }