Skip to contentSkip to conversation

ext4: memory leak on error in ext4_symlink()

PATCH In review Dan Carpenter 2 participants 2 messages Jul 24, 2015 – Jul 27, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: memory leak on error in ext4_symlink()

We should release "sd" before returning.

Fixes 0fa12ad1b285 ('ext4: Handle error from dquot_initialize()')
fs/ext4/namei.c +1 -1
index d3ff837..9f61e76 100644
@@ -3084,7 +3084,7 @@ static int ext4_symlink(struct inode *dir,
 
 	err = dquot_initialize(dir);
 	if (err)
-		return err;
+		goto err_free_sd;
 
 	if ((disk_link.len > EXT4_N_BLOCKS * 4)) {
 		/*
reviewer
#1 lore raw
Quoted 4 lines · Dan Carpenter

We should release "sd" before returning.

Fixes 0fa12ad1b285 ('ext4: Handle error from dquot_initialize()')

Thanks! I've added the fix to my tree.

Honza

Quoted 14 lines
fs/ext4/namei.c +1 -1
index d3ff837..9f61e76 100644
@@ -3084,7 +3084,7 @@ static int ext4_symlink(struct inode *dir,
 
 	err = dquot_initialize(dir);
 	if (err)
-		return err;
+		goto err_free_sd;
 
 	if ((disk_link.len > EXT4_N_BLOCKS * 4)) {
 		/*
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR