From: Jesper Juhl Date: Wed, 26 Dec 2012 20:51:12 +0000 (+0100) Subject: rtlwifi: Don't leak on error in _rtl_usb_receive() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1474a89838c44ef2c9b95401cf3a9ff5ad05d5fd;p=linux-beck.git rtlwifi: Don't leak on error in _rtl_usb_receive() We fail to release 'urb' if '_rtl_prep_rx_urb()' fails in _rtl_usb_receive(). This patch should take care of the leak. Signed-off-by: Jesper Juhl Acked-by: Larry Finger Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index a3312b7c4907..f2ecdeb3a90d 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c @@ -639,6 +639,7 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw) RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, "Failed to prep_rx_urb!!\n"); err = PTR_ERR(skb); + usb_free_urb(urb); goto err_out; }