Patchwork [net-next,6/8] qlcnic: Fix SR-IOV cleanup code path

login
register
mail settings
Submitter Shahed Shaikh
Date Jan. 10, 2014, 4:48 p.m.
Message ID <1389372539-13753-7-git-send-email-shahed.shaikh@qlogic.com>
Download mbox | patch
Permalink /patch/309348/
State Accepted
Delegated to: David Miller
Headers show

Comments

Shahed Shaikh - Jan. 10, 2014, 4:48 p.m.
From: Manish Chopra <manish.chopra@qlogic.com>

o Add __QLCNIC_SRIOV_ENABLE bit check before doing SRIOV cleanup

Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Patch

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
index bf8fca7..f998fdc 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
@@ -277,9 +277,7 @@  static void qlcnic_sriov_vf_cleanup(struct qlcnic_adapter *adapter)
 
 void qlcnic_sriov_cleanup(struct qlcnic_adapter *adapter)
 {
-	struct qlcnic_sriov *sriov = adapter->ahw->sriov;
-
-	if (!sriov)
+	if (!test_bit(__QLCNIC_SRIOV_ENABLE, &adapter->state))
 		return;
 
 	qlcnic_sriov_free_vlans(adapter);