From: Bhanu Prakash Gollapudi Date: Fri, 5 Aug 2011 00:38:36 +0000 (-0700) Subject: [SCSI] bnx2fc: Bug fixes in percpu_thread_create/destroy X-Git-Tag: v2.6.39-400.9.0~423^2~19^2~11^2~450 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1a5b547cf636ed54af114df21e7897eaa6f1a6b6;p=users%2Fjedix%2Flinux-maple.git [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 Signed-off-by: James Bottomley (cherry picked from commit 3224876358a37f6e531dd5c7f7f002106ef328fc) Signed-off-by: Joe Jin --- diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 2e37db08a5a9..8171f57e0e1e 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c @@ -2123,7 +2123,7 @@ static void bnx2fc_percpu_thread_create(unsigned int cpu) (void *)p, "bnx2fc_thread/%d", cpu); /* bind thread to the cpu */ - if (likely(!IS_ERR(p->iothread))) { + if (likely(!IS_ERR(thread))) { kthread_bind(thread, cpu); p->iothread = thread; wake_up_process(thread); @@ -2135,7 +2135,6 @@ static void bnx2fc_percpu_thread_destroy(unsigned int cpu) struct bnx2fc_percpu_s *p; struct task_struct *thread; struct bnx2fc_work *work, *tmp; - LIST_HEAD(work_list); BNX2FC_MISC_DBG("destroying io thread for CPU %d\n", cpu); @@ -2147,7 +2146,7 @@ static void bnx2fc_percpu_thread_destroy(unsigned int cpu) /* Free all work in the list */ - list_for_each_entry_safe(work, tmp, &work_list, list) { + list_for_each_entry_safe(work, tmp, &p->work_list, list) { list_del_init(&work->list); bnx2fc_process_cq_compl(work->tgt, work->wqe); kfree(work);