Commit 5e6fff16 authored by David S. Miller's avatar David S. Miller Committed by David S. Miller

[IPV6]: DST entry leak found by stanford checker.

parent c4ba645b
...@@ -441,8 +441,10 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, ...@@ -441,8 +441,10 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
src_addr = solicited_addr; src_addr = solicited_addr;
in6_ifa_put(ifp); in6_ifa_put(ifp);
} else { } else {
if (ipv6_dev_get_saddr(dev, daddr, &tmpaddr, 0)) if (ipv6_dev_get_saddr(dev, daddr, &tmpaddr, 0)) {
dst_free(dst);
return; return;
}
src_addr = &tmpaddr; src_addr = &tmpaddr;
} }
...@@ -450,11 +452,10 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, ...@@ -450,11 +452,10 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
ndisc_rt_init(rt, dev, neigh); ndisc_rt_init(rt, dev, neigh);
dst = (struct dst_entry*)rt; dst = (struct dst_entry*)rt;
dst_clone(dst);
err = xfrm_lookup(&dst, &fl, NULL, 0); err = xfrm_lookup(&dst, &fl, NULL, 0);
if (err < 0) { if (err < 0) {
dst_release(dst); dst_free(dst);
return; return;
} }
...@@ -470,6 +471,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, ...@@ -470,6 +471,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
if (skb == NULL) { if (skb == NULL) {
ND_PRINTK1("send_na: alloc skb failed\n"); ND_PRINTK1("send_na: alloc skb failed\n");
dst_free(dst);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment