]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rsi: fix memory leak on failed URB submission
authorJohan Hovold <johan@kernel.org>
Thu, 28 Nov 2019 17:22:02 +0000 (18:22 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 18 Dec 2019 18:57:05 +0000 (20:57 +0200)
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>
drivers/net/wireless/rsi/rsi_91x_usb.c

index 30bed719486ec00cc17a2bb5508f383e906917d4..2c869df1c62e833c4f10ead51f4359495ce05476 100644 (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;
 }