From: Yan Zheng <yanzheng@21cn.com>
To: linux-kernel@vger.kernel.org
Subject: [Question]No memory release after enlarge fib_info hash table
Date: Wed, 03 Aug 2005 19:18:05 +0800 [thread overview]
Message-ID: <42F0A7ED.5090802@21cn.com> (raw)
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
reply other threads:[~2005-08-03 11:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42F0A7ED.5090802@21cn.com \
--to=yanzheng@21cn.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox