Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eee12df5 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Steffen Klassert
Browse files

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: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent 2fc5f83b
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -483,8 +483,8 @@ static inline int esp_remove_trailer(struct sk_buff *skb)
		goto out;
		goto out;
	}
	}


	if (skb_copy_bits(skb, skb->len - alen - 2, nexthdr, 2))
	ret = skb_copy_bits(skb, skb->len - alen - 2, nexthdr, 2);
		BUG();
	BUG_ON(ret);


	ret = -EINVAL;
	ret = -EINVAL;
	padlen = nexthdr[0];
	padlen = nexthdr[0];