* Re: missing kfree in fs/ext3/balloc.c
@ 2005-06-18 3:09 movq movq
0 siblings, 0 replies; 3+ messages in thread
From: movq movq @ 2005-06-18 3:09 UTC (permalink / raw)
To: linux-kernel
Sorry,
Kernel version = 2.6.12 stable
--- movq movq <movq_64@yahoo.com> wrote:
> This is my first post, so be kind. Perhaps I am
> wrong
> here, but I was looking through fs/ext3/balloc.c and
> noticed this line:
>
> line 268
> ...
> block_i = kmalloc(sizeof(*block_i), GFP_NOFS);
> ...
>
> But I do not see this chunk of memory ever
> kfree()'d.
> Is there a reason for this or is this kfree() just
> missing?
>
> - Thanks
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.yahoo.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: missing kfree in fs/ext3/balloc.c
2005-06-18 2:53 movq movq
@ 2005-06-18 3:20 ` randy_dunlap
0 siblings, 0 replies; 3+ messages in thread
From: randy_dunlap @ 2005-06-18 3:20 UTC (permalink / raw)
To: movq movq; +Cc: linux-kernel
On Fri, 17 Jun 2005 19:53:12 -0700 (PDT) movq movq wrote:
| This is my first post, so be kind. Perhaps I am wrong
| here, but I was looking through fs/ext3/balloc.c and
| noticed this line:
|
| line 268
| ...
| block_i = kmalloc(sizeof(*block_i), GFP_NOFS);
| ...
|
| But I do not see this chunk of memory ever kfree()'d.
| Is there a reason for this or is this kfree() just
| missing?
It's not supposed to be freed in that function.
It is saved for later use at line 288:
ei->i_block_alloc_info = block_i;
and freed (I think) in fs/ext3/super.c::ext3_clear_inode():
EXT3_I(inode)->i_block_alloc_info = NULL;
kfree(rsv);
where rsv is:
struct ext3_block_alloc_info *rsv = EXT3_I(inode)->i_block_alloc_info;
However, back to fs/ext3/balloc.c::ext3_init_block_alloc_info():
{
struct ext3_inode_info *ei = EXT3_I(inode);
[1] struct ext3_block_alloc_info *block_i = ei->i_block_alloc_info;
struct super_block *sb = inode->i_sb;
[2] block_i = kmalloc(sizeof(*block_i), GFP_NOFS);
if (block_i) {
Seems to me that <block_i> [1] is clobbered by [2] and could be a
memory leak unless the value in [1] is always NULL....
---
~Randy
^ permalink raw reply [flat|nested] 3+ messages in thread
* missing kfree in fs/ext3/balloc.c
@ 2005-06-18 2:53 movq movq
2005-06-18 3:20 ` randy_dunlap
0 siblings, 1 reply; 3+ messages in thread
From: movq movq @ 2005-06-18 2:53 UTC (permalink / raw)
To: linux-kernel
This is my first post, so be kind. Perhaps I am wrong
here, but I was looking through fs/ext3/balloc.c and
noticed this line:
line 268
...
block_i = kmalloc(sizeof(*block_i), GFP_NOFS);
...
But I do not see this chunk of memory ever kfree()'d.
Is there a reason for this or is this kfree() just
missing?
- Thanks
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-06-18 3:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-18 3:09 missing kfree in fs/ext3/balloc.c movq movq
-- strict thread matches above, loose matches on Subject: below --
2005-06-18 2:53 movq movq
2005-06-18 3:20 ` randy_dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®