* [Question]No memory release after enlarge fib_info hash table
@ 2005-08-03 11:18 Yan Zheng
0 siblings, 0 replies; only message in thread
From: Yan Zheng @ 2005-08-03 11:18 UTC (permalink / raw)
To: linux-kernel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-08-03 11:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-03 11:18 [Question]No memory release after enlarge fib_info hash table Yan Zheng
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.