sfc: leak vports if a VF is assigned during PF unload
[linux-drm-fsl-dcu.git] / drivers / net / ethernet / sfc / efx.c
index 62b2139734336d6542f72d528d125968d1e8d387..0c42ed9c9e4c56f7556ecbde4347556ca893550c 100644 (file)
@@ -1298,7 +1298,9 @@ static void efx_fini_io(struct efx_nic *efx)
                efx->membase_phys = 0;
        }
 
-       pci_disable_device(efx->pci_dev);
+       /* Don't disable bus-mastering if VFs are assigned */
+       if (!pci_vfs_assigned(efx->pci_dev))
+               pci_disable_device(efx->pci_dev);
 }
 
 void efx_set_default_rx_indir_table(struct efx_nic *efx)