net: rtm_to_ifaddr: free ifa if ifa_cacheinfo processing fails
authorDaniel Borkmann <dborkman@redhat.com>
Fri, 2 Aug 2013 09:32:43 +0000 (11:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Sep 2013 13:54:54 +0000 (06:54 -0700)
commitb4f55925ace5646d72df5af6fdab74fdbb288229
tree4f30c77985968a48970267d419f4829014a45863
parentf4cc06ac2d9fc7a483eb778abec66f60487687f4
net: rtm_to_ifaddr: free ifa if ifa_cacheinfo processing fails

[ Upstream commit 446266b0c742a2c9ee8f0dce759a0117bce58a86 ]

Commit 5c766d642 ("ipv4: introduce address lifetime") leaves the ifa
resource that was allocated via inet_alloc_ifa() unfreed when returning
the function with -EINVAL. Thus, free it first via inet_free_ifa().

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/devinet.c