netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] af_packet: remove unnecessary BUG_ON() in tpacket_destruct_skb
@ 2011-10-10 16:52 danborkmann
  2011-10-10 17:05 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: danborkmann @ 2011-10-10 16:52 UTC (permalink / raw)
  To: Eric Dumazet, David S. Miller; +Cc: netdev@vger.kernel.org

If skb is NULL, then stack trace is thrown anyway on dereference.
Therefore, the stack trace triggered by BUG_ON is duplicate.

Signed-off-by: Daniel Borkmann <danborkmann@googlemail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
---
  net/packet/af_packet.c |    2 --
  1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index fabb4fa..886ae50 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1170,8 +1170,6 @@ static void tpacket_destruct_skb(struct sk_buff *skb)
  	struct packet_sock *po = pkt_sk(skb->sk);
  	void *ph;

-	BUG_ON(skb == NULL);
-
  	if (likely(po->tx_ring.pg_vec)) {
  		ph = skb_shinfo(skb)->destructor_arg;
  		BUG_ON(__packet_get_status(po, ph) != TP_STATUS_SENDING);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] af_packet: remove unnecessary BUG_ON() in tpacket_destruct_skb
  2011-10-10 16:52 [PATCH] af_packet: remove unnecessary BUG_ON() in tpacket_destruct_skb danborkmann
@ 2011-10-10 17:05 ` Eric Dumazet
  2011-10-10 18:09   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2011-10-10 17:05 UTC (permalink / raw)
  To: danborkmann; +Cc: David S. Miller, netdev@vger.kernel.org

Le lundi 10 octobre 2011 à 18:52 +0200, danborkmann@iogearbox.net a
écrit :
> If skb is NULL, then stack trace is thrown anyway on dereference.
> Therefore, the stack trace triggered by BUG_ON is duplicate.
> 
> Signed-off-by: Daniel Borkmann <danborkmann@googlemail.com>
> Cc: Eric Dumazet <eric.dumazet@gmail.com>


Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] af_packet: remove unnecessary BUG_ON() in tpacket_destruct_skb
  2011-10-10 17:05 ` Eric Dumazet
@ 2011-10-10 18:09   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-10-10 18:09 UTC (permalink / raw)
  To: eric.dumazet; +Cc: danborkmann, netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 10 Oct 2011 19:05:04 +0200

> Le lundi 10 octobre 2011 à 18:52 +0200, danborkmann@iogearbox.net a
> écrit :
>> If skb is NULL, then stack trace is thrown anyway on dereference.
>> Therefore, the stack trace triggered by BUG_ON is duplicate.
>> 
>> Signed-off-by: Daniel Borkmann <danborkmann@googlemail.com>
>> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> 
> 
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, but please make patches like this against the net-next tree
in which the af_packet.c code had changed quite a bit and therefore
I had to munch your patch to get it to apply.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-10 18:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-10 16:52 [PATCH] af_packet: remove unnecessary BUG_ON() in tpacket_destruct_skb danborkmann
2011-10-10 17:05 ` Eric Dumazet
2011-10-10 18:09   ` David Miller

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).