lkml.org 
[lkml]   [2010]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] omfs: fix memory leak
From
Date
Hi,

In omfs_fill_super(), when returning on error, sbi is not being freed.

Thanks,
Davidlohr.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
fs/omfs/inode.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c
index 089839a..253846e 100644
--- a/fs/omfs/inode.c
+++ b/fs/omfs/inode.c
@@ -523,12 +523,14 @@ static int omfs_fill_super(struct super_block *sb, void *data, int silent)
}
printk(KERN_DEBUG "omfs: Mounted volume %s\n", omfs_rb->r_name);

- ret = 0;
+ ret = 0; /* success */
out_brelse_bh2:
brelse(bh2);
out_brelse_bh:
brelse(bh);
end:
+ if (ret != 0)
+ kfree(sbi);
return ret;
}

--
1.7.0.4




\
 
 \ /
  Last update: 2010-07-04 04:37    [from the cache]
©2003-2011 Jasper Spaans