Netdev List
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Jesper Juhl <jj@chaosbits.net>
Cc: linux-kernel@vger.kernel.org, wlanfae <wlanfae@realtek.com>,
	netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>,
	Chaoming Li <chaoming_li@realsil.com.cn>
Subject: Re: [PATCH] rtlwifi: Don't leak on error in _rtl_usb_receive()
Date: Wed, 26 Dec 2012 15:15:20 -0600	[thread overview]
Message-ID: <50DB68E8.2010506@lwfinger.net> (raw)
In-Reply-To: <alpine.LNX.2.00.1212262145220.23814@swampdragon.chaosbits.net>

On 12/26/2012 02:51 PM, Jesper Juhl wrote:
> 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 <jj@chaosbits.net>
> ---
>   drivers/net/wireless/rtlwifi/usb.c |    1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
>   note: compile tested only.

This looks correct to me. I have never seen that RT_TRACE() fire, thus such an 
error must be uncommon, at least on my system.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Thanks,

Larry

>
> diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
> index 29f0969..75c29e6 100644
> --- a/drivers/net/wireless/rtlwifi/usb.c
> +++ b/drivers/net/wireless/rtlwifi/usb.c
> @@ -640,6 +640,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;
>   		}
>
>

      reply	other threads:[~2012-12-26 21:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-26 20:51 [PATCH] rtlwifi: Don't leak on error in _rtl_usb_receive() Jesper Juhl
2012-12-26 21:15 ` Larry Finger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50DB68E8.2010506@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=chaoming_li@realsil.com.cn \
    --cc=jj@chaosbits.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=wlanfae@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox