System panics while accessing stale pointer - timer_work_queue - in the IO path
before bnx2fc_stop is called. Fix is to destroy the workqueue after the destroy
operation is complete.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
 static int bnx2fc_destroy(struct net_device *netdev)
 {
        struct bnx2fc_interface *interface = NULL;
+       struct workqueue_struct *timer_work_queue;
        int rc = 0;
 
        rtnl_lock();
                goto netdev_err;
        }
 
-
-       destroy_workqueue(interface->timer_work_queue);
+       timer_work_queue = interface->timer_work_queue;
        __bnx2fc_destroy(interface);
+       destroy_workqueue(timer_work_queue);
 
 netdev_err:
        mutex_unlock(&bnx2fc_dev_lock);