Commit 2a7b29c5 authored by Bhanu Prakash Gollapudi's avatar Bhanu Prakash Gollapudi Committed by James Bottomley

[SCSI] bnx2fc: fix panic in bnx2fc_post_io_req

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: default avatarBhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 9f71af2f
...@@ -1537,6 +1537,7 @@ static void __bnx2fc_destroy(struct bnx2fc_interface *interface) ...@@ -1537,6 +1537,7 @@ static void __bnx2fc_destroy(struct bnx2fc_interface *interface)
static int bnx2fc_destroy(struct net_device *netdev) static int bnx2fc_destroy(struct net_device *netdev)
{ {
struct bnx2fc_interface *interface = NULL; struct bnx2fc_interface *interface = NULL;
struct workqueue_struct *timer_work_queue;
int rc = 0; int rc = 0;
rtnl_lock(); rtnl_lock();
...@@ -1549,9 +1550,9 @@ static int bnx2fc_destroy(struct net_device *netdev) ...@@ -1549,9 +1550,9 @@ static int bnx2fc_destroy(struct net_device *netdev)
goto netdev_err; goto netdev_err;
} }
timer_work_queue = interface->timer_work_queue;
destroy_workqueue(interface->timer_work_queue);
__bnx2fc_destroy(interface); __bnx2fc_destroy(interface);
destroy_workqueue(timer_work_queue);
netdev_err: netdev_err:
mutex_unlock(&bnx2fc_dev_lock); mutex_unlock(&bnx2fc_dev_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment