qlcnic: Initialize dcbnl_ops before register_netdev
authorRajesh Borundia <rajesh.borundia@qlogic.com>
Mon, 4 Aug 2014 15:51:18 +0000 (11:51 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Aug 2014 23:23:27 +0000 (16:23 -0700)
o Initialization of dcbnl_ops after register netdev may result in
  dcbnl_ops not getting set before it is being accessed from open.
  So, moving it before register_netdev.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c

index 158e1d9f255f124dd905b56dcf40f14f86ba0330..3187bc0c471bf28e11d98a4aecdadf2aa4bda17c 100644 (file)
@@ -2323,14 +2323,14 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev,
        if (err)
                return err;
 
+       qlcnic_dcb_init_dcbnl_ops(adapter->dcb);
+
        err = register_netdev(netdev);
        if (err) {
                dev_err(&pdev->dev, "failed to register net device\n");
                return err;
        }
 
-       qlcnic_dcb_init_dcbnl_ops(adapter->dcb);
-
        return 0;
 }