scsi: libcxgbi: fix incorrect DDP resource cleanup
authorVarun Prakash <varun@chelsio.com>
Sat, 5 Nov 2016 16:19:28 +0000 (21:49 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 9 Nov 2016 00:11:01 +0000 (19:11 -0500)
Before calling task_release_itt() task data is memset to zero because of
which DDP context information is lost resulting in incorrect DDP
resource cleanup, to fix this call task_release_itt() before memset.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/cxgbi/libcxgbi.c

index d1421139e6eac615d1e3ae2a9af1e02ee78d0822..2ffe029ff2b6ff29fbaaada58d277d89d2643f31 100644 (file)
@@ -2081,9 +2081,10 @@ void cxgbi_cleanup_task(struct iscsi_task *task)
        /*  never reached the xmit task callout */
        if (tdata->skb)
                __kfree_skb(tdata->skb);
-       memset(tdata, 0, sizeof(*tdata));
 
        task_release_itt(task, task->hdr_itt);
+       memset(tdata, 0, sizeof(*tdata));
+
        iscsi_tcp_cleanup_task(task);
 }
 EXPORT_SYMBOL_GPL(cxgbi_cleanup_task);