aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/devinet.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 8d48c392adcc..34ca6d5a3a4b 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -772,7 +772,7 @@ static struct in_ifaddr *rtm_to_ifaddr(struct net *net, struct nlmsghdr *nlh,
772 ci = nla_data(tb[IFA_CACHEINFO]); 772 ci = nla_data(tb[IFA_CACHEINFO]);
773 if (!ci->ifa_valid || ci->ifa_prefered > ci->ifa_valid) { 773 if (!ci->ifa_valid || ci->ifa_prefered > ci->ifa_valid) {
774 err = -EINVAL; 774 err = -EINVAL;
775 goto errout; 775 goto errout_free;
776 } 776 }
777 *pvalid_lft = ci->ifa_valid; 777 *pvalid_lft = ci->ifa_valid;
778 *pprefered_lft = ci->ifa_prefered; 778 *pprefered_lft = ci->ifa_prefered;
@@ -780,6 +780,8 @@ static struct in_ifaddr *rtm_to_ifaddr(struct net *net, struct nlmsghdr *nlh,
780 780
781 return ifa; 781 return ifa;
782 782
783errout_free:
784 inet_free_ifa(ifa);
783errout: 785errout:
784 return ERR_PTR(err); 786 return ERR_PTR(err);
785} 787}