aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-04-17 23:47:07 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-17 23:47:07 -0400
commita01c1335a308ee660518e33db03fb5f5e1dfc166 (patch)
treebd31d76a300b1c2655e026e9f618a4224bf5370e
parent482e3febc2e7df78411005dcdd7621c16b98b088 (diff)
decnet: Don't leak entries when rebuilding zone.
As noticed by Ben Hutchings, when we move entries from one table to another we leak all except the first entry. Put back the "next" variable removed by commit 9bf9055eb716f85372c41b3fbc51f90bc7653740 ("decnet: Fix set-but-unused variable.") and use it properly. Reported-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/decnet/dn_table.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c
index d8ea583076cf..bd0a52dd1d40 100644
--- a/net/decnet/dn_table.c
+++ b/net/decnet/dn_table.c
@@ -123,11 +123,12 @@ static inline void dn_rebuild_zone(struct dn_zone *dz,
123 struct dn_fib_node **old_ht, 123 struct dn_fib_node **old_ht,
124 int old_divisor) 124 int old_divisor)
125{ 125{
126 struct dn_fib_node *f, **fp, *next;
126 int i; 127 int i;
127 struct dn_fib_node *f, **fp;
128 128
129 for(i = 0; i < old_divisor; i++) { 129 for(i = 0; i < old_divisor; i++) {
130 for(f = old_ht[i]; f; f = f->fn_next) { 130 for(f = old_ht[i]; f; f = next) {
131 next = f->fn_next;
131 for(fp = dn_chain_p(f->fn_key, dz); 132 for(fp = dn_chain_p(f->fn_key, dz);
132 *fp && dn_key_leq((*fp)->fn_key, f->fn_key); 133 *fp && dn_key_leq((*fp)->fn_key, f->fn_key);
133 fp = &(*fp)->fn_next) 134 fp = &(*fp)->fn_next)