]> git.hungrycats.org Git - linux/commitdiff
[IPV6]: Fix leaks of rt6_cow()d routes in route.c
authorVille Nuorvala <vnourval@tcs.hut.fi>
Sun, 17 Aug 2003 20:49:14 +0000 (13:49 -0700)
committerDavid S. Miller <davem@nuts.ninka.net>
Sun, 17 Aug 2003 20:49:14 +0000 (13:49 -0700)
net/ipv6/route.c

index 153a866a749d3d652e4b5731fba4d06248b71116..e1e152d6c30c7d4bc6f64b96fb9f46eae9986490 100644 (file)
@@ -432,6 +432,7 @@ restart:
                /* Race condition! In the gap, when rt6_lock was
                   released someone could insert this route.  Relookup.
                */
+               dst_release(&rt->u.dst);
                goto relookup;
        }
        dst_hold(&rt->u.dst);
@@ -486,6 +487,7 @@ restart:
                /* Race condition! In the gap, when rt6_lock was
                   released someone could insert this route.  Relookup.
                */
+               dst_release(&rt->u.dst);
                goto relookup;
        }
        dst_hold(&rt->u.dst);
@@ -1094,8 +1096,8 @@ void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr,
                         */
                        dst_set_expires(&nrt->u.dst, ip6_rt_mtu_expires);
                        nrt->rt6i_flags |= RTF_DYNAMIC|RTF_EXPIRES;
-                       dst_release(&nrt->u.dst);
                }
+               dst_release(&nrt->u.dst);
        } else {
                nrt = ip6_rt_copy(rt);
                if (nrt == NULL)