diff options
author | Evgeniy Polyakov <johnpol@2ka.mipt.ru> | 2007-03-09 13:43:24 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-03-09 13:43:24 -0800 |
commit | c4e38f41e34ad853651d66227aae23e48457dce0 (patch) | |
tree | 1bbae8ba06b94474d09cf1834d8e1fabbf62162f /net | |
parent | 30fbc9f77c5a77f5f7f053d29eb92e41f6043406 (diff) | |
download | linux-3.10-c4e38f41e34ad853651d66227aae23e48457dce0.tar.gz linux-3.10-c4e38f41e34ad853651d66227aae23e48457dce0.tar.bz2 linux-3.10-c4e38f41e34ad853651d66227aae23e48457dce0.zip |
[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>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/devinet.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index e10794dc5f6..98a00d0edc7 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -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) { |