Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4e38f41 authored by Evgeniy Polyakov's avatar Evgeniy Polyakov Committed by David S. Miller
Browse files

[IPV4]: Fix rtm_to_ifaddr() error handling.



Return negative error value (embedded in the pointer) instead of
returning NULL.

Signed-off-by: default avatarEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30fbc9f7
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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) {