Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed481a33 authored by Karen Xie's avatar Karen Xie Committed by David S. Miller
Browse files

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: default avatarKaren Xie <kxie@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2126bc5e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;