提交 c4e38f41 编写于 作者: E Evgeniy Polyakov 提交者: David S. Miller

[IPV4]: Fix rtm_to_ifaddr() error handling.

Return negative error value (embedded in the pointer) instead of
returning NULL.
Signed-off-by: NEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 30fbc9f7
......@@ -502,8 +502,10 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh)
goto errout;
ifm = nlmsg_data(nlh);
if (ifm->ifa_prefixlen > 32 || tb[IFA_LOCAL] == NULL)
if (ifm->ifa_prefixlen > 32 || tb[IFA_LOCAL] == NULL) {
err = -EINVAL;
goto errout;
}
dev = __dev_get_by_index(ifm->ifa_index);
if (dev == NULL) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册