diff mbox

scsi: cxgb4i: fix Tx skb leak

Message ID 1507730587-6655-1-git-send-email-varun@chelsio.com (mailing list archive)
State Accepted
Headers show

Commit Message

Varun Prakash Oct. 11, 2017, 2:03 p.m. UTC
In case of connection reset Tx skb queue can have some
skbs which are not transmitted so purge Tx skb queue in
release_offload_resources() to avoid skb leak.

Signed-off-by: Varun Prakash <varun@chelsio.com>
---
 drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Martin K. Petersen Oct. 11, 2017, 6:28 p.m. UTC | #1
Varun,

> In case of connection reset Tx skb queue can have some skbs which are
> not transmitted so purge Tx skb queue in release_offload_resources()
> to avoid skb leak.

Applied to 4.15/scsi-queue.
diff mbox

Patch

diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
index 1d02cf9..30d5f0e 100644
--- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
+++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
@@ -1575,6 +1575,7 @@  static void release_offload_resources(struct cxgbi_sock *csk)
 		csk, csk->state, csk->flags, csk->tid);
 
 	cxgbi_sock_free_cpl_skbs(csk);
+	cxgbi_sock_purge_write_queue(csk);
 	if (csk->wr_cred != csk->wr_max_cred) {
 		cxgbi_sock_purge_wr_queue(csk);
 		cxgbi_sock_reset_wr_list(csk);