linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Måns Rullgård" <mans@mansr.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	Sebastian Frias <sf84@laposte.net>, Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org (open list)
Subject: Re: [PATCH net] net: nb8800: Fix SKB leak in nb8800_receive()
Date: Sat, 16 Jul 2016 12:01:03 +0100	[thread overview]
Message-ID: <yw1xd1mdg840.fsf@unicorn.mansr.com> (raw)
In-Reply-To: <1468626084-31618-1-git-send-email-f.fainelli@gmail.com> (Florian Fainelli's message of "Fri, 15 Jul 2016 16:41:16 -0700")

Florian Fainelli <f.fainelli@gmail.com> writes:

> In case nb8800_receive() fails to allocate a fragment, we would leak the
> SKB freshly allocated and just return, instead, free it.
>
> Reported-by: coverity (CID 1341750)
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Acked-by: Mans Rullgard <mans@mansr.com>

> ---
>  drivers/net/ethernet/aurora/nb8800.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c
> index 08a23e6b60e9..1a3555d03a96 100644
> --- a/drivers/net/ethernet/aurora/nb8800.c
> +++ b/drivers/net/ethernet/aurora/nb8800.c
> @@ -259,6 +259,7 @@ static void nb8800_receive(struct net_device *dev, unsigned int i,
>  		if (err) {
>  			netdev_err(dev, "rx buffer allocation failed\n");
>  			dev->stats.rx_dropped++;
> +			dev_kfree_skb(skb);
>  			return;
>  		}
>
> -- 
> 2.7.4
>

-- 
Måns Rullgård

  reply	other threads:[~2016-07-16 11:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-15 23:41 [PATCH net] net: nb8800: Fix SKB leak in nb8800_receive() Florian Fainelli
2016-07-16 11:01 ` Måns Rullgård [this message]
2016-07-17  5:06 ` David Miller

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=yw1xd1mdg840.fsf@unicorn.mansr.com \
    --to=mans@mansr.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sf84@laposte.net \
    /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;
as well as URLs for NNTP newsgroup(s).