Skip to contentSkip to conversation

ext4: typo leads to small leak

PATCH In review Dan Carpenter 2 participants 2 messages Mar 27, 2009 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: typo leads to small leak

This was found by smatch (http://repo.or.cz/w/smatch.git/)

regards,
dan carpenter

fs/ext4/mballoc.c +1 -1
@@ -2693,7 +2693,7 @@
 	i = (sb->s_blocksize_bits + 2) * sizeof(unsigned int);
 	sbi->s_mb_maxs = kmalloc(i, GFP_KERNEL);
 	if (sbi->s_mb_maxs == NULL) {
-		kfree(sbi->s_mb_maxs);
+		kfree(sbi->s_mb_offsets);
 		return -ENOMEM;
 	}
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

This was found by smatch (http://repo.or.cz/w/smatch.git/)

regards,
dan carpenter

Thanks! Maybe one for the stable trees.

Quoted 15 lines
fs/ext4/mballoc.c +1 -2
@@ -2693,7 +2693,7 @@
 	i = (sb->s_blocksize_bits + 2) * sizeof(unsigned int);
 	sbi->s_mb_maxs = kmalloc(i, GFP_KERNEL);
 	if (sbi->s_mb_maxs == NULL) {
-		kfree(sbi->s_mb_maxs);
+		kfree(sbi->s_mb_offsets);
 		return -ENOMEM;
 	}
 
--

To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html