]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
ath10k: fix memory leak
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Fri, 20 Sep 2019 01:36:26 +0000 (20:36 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jan 2020 19:07:07 +0000 (20:07 +0100)
commit b8d17e7d93d2beb89e4f34c59996376b8b544792 upstream.

In ath10k_usb_hif_tx_sg the allocated urb should be released if
usb_submit_urb fails.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/ath/ath10k/usb.c

index f9c79e21ab22abfe044b9566f4425f05214a85f3..c64a03f164c0f4e0ee2373081400334b9ee91974 100644 (file)
@@ -454,6 +454,7 @@ static int ath10k_usb_hif_tx_sg(struct ath10k *ar, u8 pipe_id,
                        ath10k_dbg(ar, ATH10K_DBG_USB_BULK,
                                   "usb bulk transmit failed: %d\n", ret);
                        usb_unanchor_urb(urb);
+                       usb_free_urb(urb);
                        ret = -EINVAL;
                        goto err_free_urb_to_pipe;
                }