From: Gustavo A. R. Silva Date: Sat, 21 Oct 2017 00:43:11 +0000 (-0500) Subject: net: core: rtnetlink: use BUG_ON instead of if condition followed by BUG X-Git-Tag: android-x86-8.1-r1~2235^2~352 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=058c8d59124193f46db4efa5abcd9d6d0f04c88e;p=android-x86%2Fkernel.git 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 Signed-off-by: David S. Miller --- 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) {