diff options
author | Gustavo A. R. Silva <garsilva@embeddedor.com> | 2017-10-21 02:43:11 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-23 06:31:45 +0200 |
commit | 058c8d59124193f46db4efa5abcd9d6d0f04c88e (patch) | |
tree | d48c5f0c1caed41af8c2b87c23fc82c4ae238a45 /net/core | |
parent | net: systemport: Guard against unmapped TX ring (diff) | |
download | linux-058c8d59124193f46db4efa5abcd9d6d0f04c88e.tar.xz linux-058c8d59124193f46db4efa5abcd9d6d0f04c88e.zip |
net: core: rtnetlink: use BUG_ON instead of if condition followed by BUG
Use BUG_ON instead of if condition followed by BUG in do_setlink.
This issue was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/rtnetlink.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 04680a53c8dd..df8dba998c48 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -2274,8 +2274,7 @@ static int do_setlink(const struct sk_buff *skb, rcu_read_lock(); - if (!(af_ops = rtnl_af_lookup(nla_type(af)))) - BUG(); + BUG_ON(!(af_ops = rtnl_af_lookup(nla_type(af)))); err = af_ops->set_link_af(dev, af); if (err < 0) { |