Skip to content

Commit fedc4d4

Browse files
Zheng YongjunSasha Levin
authored andcommitted
net: ipv4: Remove unneed BUG() function
[ Upstream commit 5ac6b19 ] When 'nla_parse_nested_deprecated' failed, it's no need to BUG() here, return -EINVAL is ok. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 93c2aac commit fedc4d4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/ipv4/devinet.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1989,7 +1989,7 @@ static int inet_set_link_af(struct net_device *dev, const struct nlattr *nla)
19891989
return -EAFNOSUPPORT;
19901990

19911991
if (nla_parse_nested_deprecated(tb, IFLA_INET_MAX, nla, NULL, NULL) < 0)
1992-
BUG();
1992+
return -EINVAL;
19931993

19941994
if (tb[IFLA_INET_CONF]) {
19951995
nla_for_each_nested(a, tb[IFLA_INET_CONF], rem)

‎net/ipv6/addrconf.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5799,7 +5799,7 @@ static int inet6_set_link_af(struct net_device *dev, const struct nlattr *nla)
57995799
return -EAFNOSUPPORT;
58005800

58015801
if (nla_parse_nested_deprecated(tb, IFLA_INET6_MAX, nla, NULL, NULL) < 0)
5802-
BUG();
5802+
return -EINVAL;
58035803

58045804
if (tb[IFLA_INET6_TOKEN]) {
58055805
err = inet6_set_iftoken(idev, nla_data(tb[IFLA_INET6_TOKEN]));

0 commit comments

Comments
 (0)