diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2008-02-25 16:54:37 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-02-25 16:54:37 -0500 |
commit | b35905c16ad6428551eb9e49525011bd2700cf56 (patch) | |
tree | 155ae1b76392b38a6079dcc5de15b123b3c20953 /fs/ext4/extents.c | |
parent | 4cdeed861b5f797b3fa661eb331a6bd6ad669c6a (diff) |
ext4: Fix memory and buffer head leak in callers to ext4_ext_find_extent()
The path variable returned via ext4_ext_find_extent is a kmalloc
variable and needs to be freeded. It also contains a reference to
buffer_head which needs to be dropped.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index e856f660fc30..995ac16102a9 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -349,7 +349,7 @@ static void ext4_ext_show_leaf(struct inode *inode, struct ext4_ext_path *path) | |||
349 | #define ext4_ext_show_leaf(inode,path) | 349 | #define ext4_ext_show_leaf(inode,path) |
350 | #endif | 350 | #endif |
351 | 351 | ||
352 | static void ext4_ext_drop_refs(struct ext4_ext_path *path) | 352 | void ext4_ext_drop_refs(struct ext4_ext_path *path) |
353 | { | 353 | { |
354 | int depth = path->p_depth; | 354 | int depth = path->p_depth; |
355 | int i; | 355 | int i; |
@@ -2200,10 +2200,10 @@ static int ext4_ext_convert_to_initialized(handle_t *handle, | |||
2200 | newdepth = ext_depth(inode); | 2200 | newdepth = ext_depth(inode); |
2201 | if (newdepth != depth) { | 2201 | if (newdepth != depth) { |
2202 | depth = newdepth; | 2202 | depth = newdepth; |
2203 | path = ext4_ext_find_extent(inode, iblock, NULL); | 2203 | ext4_ext_drop_refs(path); |
2204 | path = ext4_ext_find_extent(inode, iblock, path); | ||
2204 | if (IS_ERR(path)) { | 2205 | if (IS_ERR(path)) { |
2205 | err = PTR_ERR(path); | 2206 | err = PTR_ERR(path); |
2206 | path = NULL; | ||
2207 | goto out; | 2207 | goto out; |
2208 | } | 2208 | } |
2209 | eh = path[depth].p_hdr; | 2209 | eh = path[depth].p_hdr; |