netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	Sergey Lapin <slapin@ossfans.org>,
	"David S. Miller" <davem@davemloft.net>,
	"open list:IEEE 802.15.4 SUB..."
	<linux-zigbee-devel@lists.sourceforge.net>,
	"open list:NETWORKING [GENERAL]" <netdev@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch 1/3 -next] 6LoWPAN: use kfree_skb() instead of kfree()
Date: Tue, 30 Aug 2011 16:40:48 +0200	[thread overview]
Message-ID: <1314715248.2935.25.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> (raw)
In-Reply-To: <20110830134552.GH3705@shale.localdomain>

Le mardi 30 août 2011 à 16:45 +0300, Dan Carpenter a écrit :
> Use kfree_skb() to free sbk_buffs.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
> index cf304cc..8a9dbaa 100644
> --- a/net/ieee802154/6lowpan.c
> +++ b/net/ieee802154/6lowpan.c
> @@ -674,7 +674,7 @@ lowpan_process_data(struct sk_buff *skb)
>  							sizeof(hdr));
>  	return lowpan_skb_deliver(skb, &hdr);
>  drop:
> -	kfree(skb);
> +	kfree_skb(skb);
>  	return -EINVAL;
>  }
>  

Another bug is the skb_copy() done in lowpan_skb_deliver()

1) No check of skb_copy() return 

2.1) Use of GFP_KERNEL : Is it safe at this point ? Aren’t we in
softirq ?

2.2) If GFP_KERNEL is safe, why do we later do :

	if (in_interrupt())
		stat = netif_rx(skb);
	else
		stat = netif_rx_ni(skb);

  reply	other threads:[~2011-08-30 14:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-30 13:45 [patch 1/3 -next] 6LoWPAN: use kfree_skb() instead of kfree() Dan Carpenter
2011-08-30 14:40 ` Eric Dumazet [this message]
2011-09-01  9:26   ` Alexander Smirnov
2011-09-01 15:04     ` Dan Carpenter
2011-09-01 15:06       ` Dan Carpenter
     [not found] ` <20110830134552.GH3705-z0WHZYlhLlzP0Z7Jsv878P8+0UxHXcjY@public.gmane.org>
2011-09-15 19:42   ` 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=1314715248.2935.25.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC \
    --to=eric.dumazet@gmail.com \
    --cc=alex.bluesman.smirnov@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dbaryshkov@gmail.com \
    --cc=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-zigbee-devel@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=slapin@ossfans.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;
as well as URLs for NNTP newsgroup(s).