mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-09-21 12:11:49 +08:00
ipv4: delete redundant judgment statements
The initial value of err is -ENOBUFS, and err is guaranteed to be less than 0 before all goto errout. Therefore, on the error path of errout, there is no need to repeatedly judge that err is less than 0, and delete redundant judgments to make the code more concise. Signed-off-by: Li Zetao <lizetao1@huawei.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2d522384fb
commit
4c18088777
@ -1943,7 +1943,6 @@ static void rtmsg_ifa(int event, struct in_ifaddr *ifa, struct nlmsghdr *nlh,
|
||||
rtnl_notify(skb, net, portid, RTNLGRP_IPV4_IFADDR, nlh, GFP_KERNEL);
|
||||
return;
|
||||
errout:
|
||||
if (err < 0)
|
||||
rtnl_set_sk_err(net, RTNLGRP_IPV4_IFADDR, err);
|
||||
}
|
||||
|
||||
@ -2140,7 +2139,6 @@ void inet_netconf_notify_devconf(struct net *net, int event, int type,
|
||||
rtnl_notify(skb, net, 0, RTNLGRP_IPV4_NETCONF, NULL, GFP_KERNEL);
|
||||
return;
|
||||
errout:
|
||||
if (err < 0)
|
||||
rtnl_set_sk_err(net, RTNLGRP_IPV4_NETCONF, err);
|
||||
}
|
||||
|
||||
|
@ -543,7 +543,6 @@ void rtmsg_fib(int event, __be32 key, struct fib_alias *fa,
|
||||
info->nlh, GFP_KERNEL);
|
||||
return;
|
||||
errout:
|
||||
if (err < 0)
|
||||
rtnl_set_sk_err(info->nl_net, RTNLGRP_IPV4_ROUTE, err);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user