]> git.itanic.dy.fi Git - linux-stable/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Feb 2020 09:37:11 +0000 (09:37 +0000)
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>
drivers/net/wireless/rsi/rsi_91x_usb.c

index 84b7a96519af8160f32289de527c32180b47891e..607d4d443531501508a8be9c352cdfa4eafdbe6c 100644 (file)
@@ -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;
 }