aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/extents.c6
-rw-r--r--fs/ext4/migrate.c5
2 files changed, 8 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
352static void ext4_ext_drop_refs(struct ext4_ext_path *path) 352void 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;
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
index 8c6c685b9d22..5c1e27de7755 100644
--- a/fs/ext4/migrate.c
+++ b/fs/ext4/migrate.c
@@ -43,6 +43,7 @@ static int finish_range(handle_t *handle, struct inode *inode,
43 43
44 if (IS_ERR(path)) { 44 if (IS_ERR(path)) {
45 retval = PTR_ERR(path); 45 retval = PTR_ERR(path);
46 path = NULL;
46 goto err_out; 47 goto err_out;
47 } 48 }
48 49
@@ -74,6 +75,10 @@ static int finish_range(handle_t *handle, struct inode *inode,
74 } 75 }
75 retval = ext4_ext_insert_extent(handle, inode, path, &newext); 76 retval = ext4_ext_insert_extent(handle, inode, path, &newext);
76err_out: 77err_out:
78 if (path) {
79 ext4_ext_drop_refs(path);
80 kfree(path);
81 }
77 lb->first_pblock = 0; 82 lb->first_pblock = 0;
78 return retval; 83 return retval;
79} 84}