Commit 058c8d59 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by David S. Miller

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: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e83b1715
...@@ -2274,8 +2274,7 @@ static int do_setlink(const struct sk_buff *skb, ...@@ -2274,8 +2274,7 @@ static int do_setlink(const struct sk_buff *skb,
rcu_read_lock(); rcu_read_lock();
if (!(af_ops = rtnl_af_lookup(nla_type(af)))) BUG_ON(!(af_ops = rtnl_af_lookup(nla_type(af))));
BUG();
err = af_ops->set_link_af(dev, af); err = af_ops->set_link_af(dev, af);
if (err < 0) { if (err < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment