diff options
author | Bhanu Prakash Gollapudi <bprakash@broadcom.com> | 2011-08-04 20:38:36 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-08-27 10:35:25 -0400 |
commit | 3224876358a37f6e531dd5c7f7f002106ef328fc (patch) | |
tree | 44e104af0321e29f2bf7478dc0f26cf31d202f73 /drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |
parent | 627e628f6662550455e57466148d03f354ecdd3b (diff) |
[SCSI] bnx2fc: Bug fixes in percpu_thread_create/destroy
Look up p->work_list to process cq completions, and correct the error check for
thread creation.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_fcoe.c')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index ea1e6cccd435..a4770d9fc80e 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |||
@@ -2122,7 +2122,7 @@ static void bnx2fc_percpu_thread_create(unsigned int cpu) | |||
2122 | (void *)p, | 2122 | (void *)p, |
2123 | "bnx2fc_thread/%d", cpu); | 2123 | "bnx2fc_thread/%d", cpu); |
2124 | /* bind thread to the cpu */ | 2124 | /* bind thread to the cpu */ |
2125 | if (likely(!IS_ERR(p->iothread))) { | 2125 | if (likely(!IS_ERR(thread))) { |
2126 | kthread_bind(thread, cpu); | 2126 | kthread_bind(thread, cpu); |
2127 | p->iothread = thread; | 2127 | p->iothread = thread; |
2128 | wake_up_process(thread); | 2128 | wake_up_process(thread); |
@@ -2134,7 +2134,6 @@ static void bnx2fc_percpu_thread_destroy(unsigned int cpu) | |||
2134 | struct bnx2fc_percpu_s *p; | 2134 | struct bnx2fc_percpu_s *p; |
2135 | struct task_struct *thread; | 2135 | struct task_struct *thread; |
2136 | struct bnx2fc_work *work, *tmp; | 2136 | struct bnx2fc_work *work, *tmp; |
2137 | LIST_HEAD(work_list); | ||
2138 | 2137 | ||
2139 | BNX2FC_MISC_DBG("destroying io thread for CPU %d\n", cpu); | 2138 | BNX2FC_MISC_DBG("destroying io thread for CPU %d\n", cpu); |
2140 | 2139 | ||
@@ -2146,7 +2145,7 @@ static void bnx2fc_percpu_thread_destroy(unsigned int cpu) | |||
2146 | 2145 | ||
2147 | 2146 | ||
2148 | /* Free all work in the list */ | 2147 | /* Free all work in the list */ |
2149 | list_for_each_entry_safe(work, tmp, &work_list, list) { | 2148 | list_for_each_entry_safe(work, tmp, &p->work_list, list) { |
2150 | list_del_init(&work->list); | 2149 | list_del_init(&work->list); |
2151 | bnx2fc_process_cq_compl(work->tgt, work->wqe); | 2150 | bnx2fc_process_cq_compl(work->tgt, work->wqe); |
2152 | kfree(work); | 2151 | kfree(work); |