qlcnic: Fix panic due to uninitialzed delayed_work struct in use.
authorSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Mon, 14 Apr 2014 14:02:18 +0000 (10:02 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Apr 2014 17:43:52 +0000 (13:43 -0400)
o AEN event was being received before initializing delayed_work struct
  and handlers for it. This was resulting in crash. This patch fixes it.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c

index b48737dcd3c59bbf68e17469d76edfe5e906a53b..d211af70c7ec2c5e181b654e1afbbdeac4bfad45 100644 (file)
@@ -2348,14 +2348,13 @@ int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac)
                goto disable_intr;
        }
 
+       INIT_DELAYED_WORK(&adapter->idc_aen_work, qlcnic_83xx_idc_aen_work);
+
        err = qlcnic_83xx_setup_mbx_intr(adapter);
        if (err)
                goto disable_mbx_intr;
 
        qlcnic_83xx_clear_function_resources(adapter);
-
-       INIT_DELAYED_WORK(&adapter->idc_aen_work, qlcnic_83xx_idc_aen_work);
-
        qlcnic_83xx_initialize_nic(adapter, 1);
 
        /* Configure default, SR-IOV or Virtual NIC mode of operation */