ath10k: fix memory leak
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Fri, 20 Sep 2019 01:36:26 +0000 (20:36 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 23 Sep 2019 08:28:50 +0000 (11:28 +0300)
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>
drivers/net/wireless/ath/ath10k/usb.c

index e1420f6..730ed22 100644 (file)
@@ -435,6 +435,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;
                }