Skip to content

Commit

Permalink
af_packet: remove unnecessary BUG_ON() in tpacket_destruct_skb
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
danborkmann@iogearbox.net authored and David S. Miller committed Oct 10, 2011
1 parent 5bdc4f5 commit 95f5f80
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1968,8 +1968,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);
Expand Down

0 comments on commit 95f5f80

Please sign in to comment.