diff options
author | Hariprasad Kelam <hariprasad.kelam@gmail.com> | 2019-06-08 11:00:50 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-10 04:56:42 +0200 |
commit | de47c5d8e11dda678e4354eeb4235e58e92f7cd2 (patch) | |
tree | be2426a42ca9029c4de8338f532eefa34457ab3c /net | |
parent | ipv6: tcp: fix potential NULL deref in tcp_v6_send_reset() (diff) | |
download | linux-de47c5d8e11dda678e4354eeb4235e58e92f7cd2.tar.xz linux-de47c5d8e11dda678e4354eeb4235e58e92f7cd2.zip |
af_key: make use of BUG_ON macro
fix below warnings reported by coccicheck
net/key/af_key.c:932:2-5: WARNING: Use BUG_ON instead of if condition
followed by BUG.
net/key/af_key.c:948:2-5: WARNING: Use BUG_ON instead of if condition
followed by BUG.
Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/key/af_key.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c index a50dd6f34b91..39b3d95094eb 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -928,8 +928,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x, pfkey_sockaddr_fill(&x->props.saddr, 0, (struct sockaddr *) (addr + 1), x->props.family); - if (!addr->sadb_address_prefixlen) - BUG(); + BUG_ON(!addr->sadb_address_prefixlen); /* dst address */ addr = skb_put(skb, sizeof(struct sadb_address) + sockaddr_size); @@ -944,8 +943,7 @@ static struct sk_buff *__pfkey_xfrm_state2msg(const struct xfrm_state *x, pfkey_sockaddr_fill(&x->id.daddr, 0, (struct sockaddr *) (addr + 1), x->props.family); - if (!addr->sadb_address_prefixlen) - BUG(); + BUG_ON(!addr->sadb_address_prefixlen); if (!xfrm_addr_equal(&x->sel.saddr, &x->props.saddr, x->props.family)) { |