1
0
Fork 0

rsi: fix memory leak on failed URB submission

commit 4776829748 upstream.

Make sure to free the skb on failed receive-URB submission (e.g. on
disconnect or currently also due to a missing endpoint).

Fixes: a1854fae14 ("rsi: improve RX packet handling in USB interface")
Cc: stable <stable@vger.kernel.org>     # 4.17
Cc: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5.4-rM2-2.2.x-imx-squashed
Johan Hovold 2019-11-28 18:22:02 +01:00 committed by Greg Kroah-Hartman
parent 2d367468ec
commit 1f04209d19
1 changed files with 3 additions and 1 deletions

View File

@ -338,8 +338,10 @@ static int rsi_rx_urb_submit(struct rsi_hw *adapter, u8 ep_num)
rx_cb);
status = usb_submit_urb(urb, GFP_KERNEL);
if (status)
if (status) {
rsi_dbg(ERR_ZONE, "%s: Failed in urb submission\n", __func__);
dev_kfree_skb(skb);
}
return status;
}