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

Commit 1f04209d authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

rsi: fix memory leak on failed URB submission



commit 47768297481184932844ab01a86752ba31a38861 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: a1854fae ("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: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2d367468
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -338,8 +338,10 @@ static int rsi_rx_urb_submit(struct rsi_hw *adapter, u8 ep_num)
			  rx_cb);
			  rx_cb);


	status = usb_submit_urb(urb, GFP_KERNEL);
	status = usb_submit_urb(urb, GFP_KERNEL);
	if (status)
	if (status) {
		rsi_dbg(ERR_ZONE, "%s: Failed in urb submission\n", __func__);
		rsi_dbg(ERR_ZONE, "%s: Failed in urb submission\n", __func__);
		dev_kfree_skb(skb);
	}


	return status;
	return status;
}
}