aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2019-11-28 18:22:02 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-01 09:37:11 +0000
commit71b815b0cc40f06c605ed77b6df9c50ba1f5a7fe (patch)
tree52f399f37c8f8077bb1314d9fa366326e581b7cf
parent1b6b6371784977c2fb2353c63ffc260b46f17f96 (diff)
downloadlinux-yocto-71b815b0cc40f06c605ed77b6df9c50ba1f5a7fe.tar.gz
linux-yocto-71b815b0cc40f06c605ed77b6df9c50ba1f5a7fe.tar.bz2
linux-yocto-71b815b0cc40f06c605ed77b6df9c50ba1f5a7fe.zip
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: a1854fae1414 ("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>
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_usb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
index 84b7a96519af..607d4d443531 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
@@ -327,8 +327,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;
}