ipv6: Use BUG_ON
authorHimangi Saraogi <himangi774@gmail.com>
Fri, 11 Jul 2014 20:27:17 +0000 (01:57 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Jul 2014 22:06:38 +0000 (15:06 -0700)
The semantic patch that makes this transformation is as follows:

// <smpl>
@@ expression e; @@
-if (e) BUG();
+BUG_ON(e);
// </smpl>

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_output.c

index fa83bdd4c3dddd18a40eeea020bdad3cfd534162..9b395c639a07929ed044575f2aad71f1aadcc299 100644 (file)
@@ -801,8 +801,8 @@ slow_path:
                /*
                 *      Copy a block of the IP datagram.
                 */
-               if (skb_copy_bits(skb, ptr, skb_transport_header(frag), len))
-                       BUG();
+               BUG_ON(skb_copy_bits(skb, ptr, skb_transport_header(frag),
+                                    len));
                left -= len;
 
                fh->frag_off = htons(offset);