scsi: cxgb4i: fix Tx skb leak
authorVarun Prakash <varun@chelsio.com>
Wed, 11 Oct 2017 14:03:07 +0000 (19:33 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Dec 2017 13:22:14 +0000 (14:22 +0100)
[ Upstream commit 9b3a081fb62158b50bcc90522ca2423017544367 ]

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>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c

index 804806e1cbb4be79d3223a2d5684de4c6ff58afd..7a48905b8195068b262eb003854c43f10fabc864 100644 (file)
@@ -1339,6 +1339,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);