summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorShmulik Ladkani <shmulik.ladkani@gmail.com>2012-04-03 23:13:00 +0000
committerDavid S. Miller <davem@davemloft.net>2012-04-04 05:25:51 -0400
commit2173bff5dcff4ca02226978f39648b66a8c3ca1e (patch)
treeb092c689b8afed67395efbb61fd8f01d3770f8c8 /net/ipv6
parent7ebae8177e615d3137d5365757d9d5d7d6ca8a98 (diff)
downloadop-kernel-dev-2173bff5dcff4ca02226978f39648b66a8c3ca1e.zip
op-kernel-dev-2173bff5dcff4ca02226978f39648b66a8c3ca1e.tar.gz
ipv6: Fix 'inet6_rtm_getroute' to release 'rt->dst' in case of 'alloc_skb' failure
In 72331bc [ipv6: Fix RTM_GETROUTE's interpretation of RTA_IIF to be consistent with ipv4] the code of 'inet6_rtm_getroute()' was re-ordered such that the reference to 'rt->dst' is incremented prior skb allocation. Hence, if 'alloc_skb()' fails, must drop a reference from 'rt->dst'. Add the missing 'dst_release()' call. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/route.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 4d70c06..8c5df6f 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2606,6 +2606,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
if (!skb) {
+ dst_release(&rt->dst);
err = -ENOBUFS;
goto errout;
}
OpenPOWER on IntegriCloud