summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorKaren Xie <kxie@chelsio.com>2014-12-11 19:13:47 -0800
committerDavid S. Miller <davem@davemloft.net>2014-12-12 11:22:30 -0500
commited481a33ee824bfee20319fc478503926bcf5f56 (patch)
treea1f9de6d0543bfc7b45a9d9a9088eb6f446a28ef /drivers/scsi
parent2126bc5e872cefd808a6590c5cec797997a6490d (diff)
downloadlinux-ed481a33ee824bfee20319fc478503926bcf5f56.tar.gz
linux-ed481a33ee824bfee20319fc478503926bcf5f56.tar.bz2
linux-ed481a33ee824bfee20319fc478503926bcf5f56.zip
libcxgbi: fix freeing skb prematurely
With debug turned on the debug print would access the skb after it is freed. Fix it to free the skb after the debug print. Signed-off-by: Karen Xie <kxie@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/cxgbi/libcxgbi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index 7da59c38a69e..eb58afcfb73b 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -2294,10 +2294,12 @@ int cxgbi_conn_xmit_pdu(struct iscsi_task *task)
return err;
}
- kfree_skb(skb);
log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
"itt 0x%x, skb 0x%p, len %u/%u, xmit err %d.\n",
task->itt, skb, skb->len, skb->data_len, err);
+
+ kfree_skb(skb);
+
iscsi_conn_printk(KERN_ERR, task->conn, "xmit err %d.\n", err);
iscsi_conn_failure(task->conn, ISCSI_ERR_XMIT_FAILED);
return err;