Netdev List
 help / color / mirror / Atom feed
From: Dan Williams <dcbw@redhat.com>
To: Jesper Juhl <jj@chaosbits.net>
Cc: libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Andrey Yurovsky <andrey@cozybit.com>,
	Colin McCabe <colin@cozybit.com>,
	"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [PATCH] Net, libertas: Resolve memory leak in if_spi_host_to_card()
Date: Mon, 14 Nov 2011 16:43:10 -0600	[thread overview]
Message-ID: <1321310590.16847.3.camel@dcbw.foobar.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1111132211580.3368@swampdragon.chaosbits.net>

On Sun, 2011-11-13 at 22:14 +0100, Jesper Juhl wrote:
> If we hit the default case in the switch in if_spi_host_to_card() we'll leak
> the memory we allocated for 'packet'. This patch resolves the leak by freeing
> the allocated memory in that case.
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Acked-by: Dan Williams <dcbw@redhat.com>

> ---
>  drivers/net/wireless/libertas/if_spi.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
>  Compile tested only due to lack of hardware.
> 
> diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
> index 11b69b3..728baa4 100644
> --- a/drivers/net/wireless/libertas/if_spi.c
> +++ b/drivers/net/wireless/libertas/if_spi.c
> @@ -995,6 +995,7 @@ static int if_spi_host_to_card(struct lbs_private *priv,
>  		spin_unlock_irqrestore(&card->buffer_lock, flags);
>  		break;
>  	default:
> +		kfree(packet);
>  		netdev_err(priv->dev, "can't transfer buffer of type %d\n",
>  			   type);
>  		err = -EINVAL;
> -- 
> 1.7.7.3
> 
> 

      reply	other threads:[~2011-11-14 22:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-13 21:14 [PATCH] Net, libertas: Resolve memory leak in if_spi_host_to_card() Jesper Juhl
2011-11-14 22:43 ` Dan Williams [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=1321310590.16847.3.camel@dcbw.foobar.com \
    --to=dcbw@redhat.com \
    --cc=andrey@cozybit.com \
    --cc=colin@cozybit.com \
    --cc=davem@davemloft.net \
    --cc=jj@chaosbits.net \
    --cc=libertas-dev@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    /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