From: Evgeniy Polyakov Date: Fri, 9 Mar 2007 21:43:24 +0000 (-0800) Subject: [IPV4]: Fix rtm_to_ifaddr() error handling. X-Git-Tag: v2.6.21-rc4~50^2~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4e38f41e34ad853651d66227aae23e48457dce0;p=linux-2.6 [IPV4]: Fix rtm_to_ifaddr() error handling. Return negative error value (embedded in the pointer) instead of returning NULL. Signed-off-by: Evgeniy Polyakov Signed-off-by: David S. Miller --- diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index e10794dc5f..98a00d0edc 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) {