diff options
author | Evgeniy Polyakov <johnpol@2ka.mipt.ru> | 2007-03-09 23:04:42 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-03-23 12:49:21 -0700 |
commit | 1995b605df589e93a11395ca239891187b7f1bdf (patch) | |
tree | fbf29354610e20f8eb66dd4f0dee65a5cde09ea8 /net | |
parent | 4cabf6ba5496bc4a5a59871693145880b240b07b (diff) |
Fix rtm_to_ifaddr() error return.
[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>
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 480ace9819f..728ba5ffe43 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -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) { |