]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Fix rtm_to_ifaddr() error return.
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Sat, 10 Mar 2007 07:04:42 +0000 (23:04 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 23 Mar 2007 19:49:21 +0000 (12:49 -0700)
[IPV4]: Fix rtm_to_ifaddr() error handling.

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

Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/devinet.c

index 480ace9819f6d97ea0245b742445481f7fcb14e5..728ba5ffe43c6da75173887a0279814c9a09691c 100644 (file)
@@ -503,8 +503,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) {