]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
[SCSI] bnx2fc: Bug fixes in percpu_thread_create/destroy
authorBhanu Prakash Gollapudi <bprakash@broadcom.com>
Fri, 5 Aug 2011 00:38:36 +0000 (17:38 -0700)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 01:07:45 +0000 (09:07 +0800)
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>
(cherry picked from commit 3224876358a37f6e531dd5c7f7f002106ef328fc)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/scsi/bnx2fc/bnx2fc_fcoe.c

index 2e37db08a5a9f82c689c43a1de6771bbae4b5a59..8171f57e0e1eb7f2c5bb6a28b7665f8ab8f8828d 100644 (file)
@@ -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);