Skip to content

Commit a01c133

Browse files
committed
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 9bf9055 ("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>
1 parent 482e3fe commit a01c133

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎net/decnet/dn_table.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,12 @@ static inline void dn_rebuild_zone(struct dn_zone *dz,
123123
struct dn_fib_node **old_ht,
124124
int old_divisor)
125125
{
126+
struct dn_fib_node *f, **fp, *next;
126127
int i;
127-
struct dn_fib_node *f, **fp;
128128

129129
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;
131132
for(fp = dn_chain_p(f->fn_key, dz);
132133
*fp && dn_key_leq((*fp)->fn_key, f->fn_key);
133134
fp = &(*fp)->fn_next)

0 commit comments

Comments
 (0)