lkml.org 
[lkml]   [2005]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[Question]No memory release after enlarge fib_info hash table
linux 2.6.12.3

net/ipv4/fib_semantics.c:line 679


if (fib_info_cnt >= fib_hash_size) {
unsigned int new_size = fib_hash_size << 1;
struct hlist_head *new_info_hash;
struct hlist_head *new_laddrhash;
unsigned int bytes;

if (!new_size)
new_size = 1;
bytes = new_size * sizeof(struct hlist_head *);
new_info_hash = fib_hash_alloc(bytes);
new_laddrhash = fib_hash_alloc(bytes);
if (!new_info_hash || !new_laddrhash) {
fib_hash_free(new_info_hash, bytes);
fib_hash_free(new_laddrhash, bytes);
} else {
memset(new_info_hash, 0, bytes);
memset(new_laddrhash, 0, bytes);

fib_hash_move(new_info_hash, new_laddrhash,
new_size);
}

if (!fib_hash_size)
goto failure;
}

In fib_hash_move, there is no code call fib_hash_free to release memory
used by old hash table. after call fib_hash_move, fib_info_hash and
fib_info_laddrhash are the new memory addresses , old addresses are
lost. Is this a bug?

thanks
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-03 13:20    [W:0.126 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site