OSDN Git Service

scsi: libcxgbi: simplify task->hdr allocation for mgmt cmds
authorVarun Prakash <varun@chelsio.com>
Wed, 11 Oct 2017 14:03:21 +0000 (19:33 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 11 Oct 2017 18:26:49 +0000 (14:26 -0400)
commit2269848386c4b8395bc67eaaf7d08011da7c07ef
tree5bfdb300156c62f189890dc004f2b19a62461a26
parent9b3a081fb62158b50bcc90522ca2423017544367
scsi: libcxgbi: simplify task->hdr allocation for mgmt cmds

In case of mgmt cmds, task->hdr is dereferenced after transmitting the
pdu in iscsi_tcp_task_xmit(). To handle this case current code
increments the Tx skb reference count and frees the skb in
cxgbi_cleanup_task(). In some error cases this results in skb leak.

To fix this in case of mgmt cmds, allocate a separate buffer for iSCSI
hdr and free this buffer in cxgbi_cleanup_task().

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