diff options
author | Gustavo A. R. Silva <garsilva@embeddedor.com> | 2017-10-26 15:51:06 +0300 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2017-10-27 09:02:00 +0300 |
commit | eee12df5a0bd5769af5efb72fa95dd1f633a266c (patch) | |
tree | 4e04dc40c9ad9e206b35a13ca98adf5370fabbde /net/ipv6/esp6.c | |
parent | 2fc5f83b92ba93f8f7119461d998bcdb1ac519ac (diff) | |
download | linux-eee12df5a0bd5769af5efb72fa95dd1f633a266c.tar.xz |
ipv6: esp6: use BUG_ON instead of if condition followed by BUG
Use BUG_ON instead of if condition followed by BUG in esp_remove_trailer.
This issue was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv6/esp6.c')
-rw-r--r-- | net/ipv6/esp6.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index 1696401fed6c..4000b71bfdc5 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c @@ -483,8 +483,8 @@ static inline int esp_remove_trailer(struct sk_buff *skb) goto out; } - if (skb_copy_bits(skb, skb->len - alen - 2, nexthdr, 2)) - BUG(); + ret = skb_copy_bits(skb, skb->len - alen - 2, nexthdr, 2); + BUG_ON(ret); ret = -EINVAL; padlen = nexthdr[0]; |