From: Bhanu Prakash Gollapudi Date: Tue, 24 Jan 2012 02:00:46 +0000 (-0800) Subject: bnx2fc: fix panic in bnx2fc_post_io_req X-Git-Tag: v2.6.39-400.9.0~423^2~19^2~11^2~414 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8c2206f521288a3352deb2a887d09aab5caa67df;p=users%2Fjedix%2Flinux-maple.git 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: Bhanu Prakash Gollapudi Signed-off-by: James Bottomley (cherry picked from commit 2a7b29c5f267c143e280c1a5174a0d930bd6c1e3) Signed-off-by: Joe Jin --- diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index dda0bca8f107b..6e38f63b51246 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c @@ -1536,6 +1536,7 @@ static void __bnx2fc_destroy(struct bnx2fc_interface *interface) static int bnx2fc_destroy(struct net_device *netdev) { struct bnx2fc_interface *interface = NULL; + struct workqueue_struct *timer_work_queue; int rc = 0; rtnl_lock(); @@ -1548,9 +1549,9 @@ static int bnx2fc_destroy(struct net_device *netdev) 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);