diff options
author | Evgeniy Polyakov <johnpol@2ka.mipt.ru> | 2007-03-09 16:43:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-03-09 16:43:24 -0500 |
commit | c4e38f41e34ad853651d66227aae23e48457dce0 (patch) | |
tree | 1bbae8ba06b94474d09cf1834d8e1fabbf62162f /net/ipv4/devinet.c | |
parent | 30fbc9f77c5a77f5f7f053d29eb92e41f6043406 (diff) |
[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/ipv4/devinet.c')
-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 e10794dc5f64..98a00d0edc76 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) | |||
502 | goto errout; | 502 | goto errout; |
503 | 503 | ||
504 | ifm = nlmsg_data(nlh); | 504 | ifm = nlmsg_data(nlh); |
505 | if (ifm->ifa_prefixlen > 32 || tb[IFA_LOCAL] == NULL) | 505 | if (ifm->ifa_prefixlen > 32 || tb[IFA_LOCAL] == NULL) { |
506 | err = -EINVAL; | ||
506 | goto errout; | 507 | goto errout; |
508 | } | ||
507 | 509 | ||
508 | dev = __dev_get_by_index(ifm->ifa_index); | 510 | dev = __dev_get_by_index(ifm->ifa_index); |
509 | if (dev == NULL) { | 511 | if (dev == NULL) { |