2009-03-27 10:39:18

by Dan Carpenter

[permalink] [raw]
Subject: [patch] ext4: typo leads to small leak

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

regards,
dan carpenter

Signed-off-by: Dan Carpenter <[email protected]>

--- orig/fs/ext4/mballoc.c 2009-03-26 18:22:30.000000000 +0300
+++ devel/fs/ext4/mballoc.c 2009-03-26 18:22:56.000000000 +0300
@@ -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;
}



2009-03-27 14:13:37

by Eric Sandeen

[permalink] [raw]
Subject: Re: [patch] ext4: typo leads to small leak

Dan Carpenter wrote:
> This was found by smatch (http://repo.or.cz/w/smatch.git/)
>
> regards,
> dan carpenter
>
> Signed-off-by: Dan Carpenter <[email protected]>

Reviewed-by: Eric Sandeen <[email protected]>

Thanks! Maybe one for the stable trees.

> --- orig/fs/ext4/mballoc.c 2009-03-26 18:22:30.000000000 +0300
> +++ devel/fs/ext4/mballoc.c 2009-03-26 18:22:56.000000000 +0300
> @@ -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