lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 3 Sep 2012 09:23:22 +0530
From:	prasad <prasadjoshi.linux@...il.com>
To:	Wei Yongjun <weiyj.lk@...il.com>,   ".@prasadjoshi.linux"@gmail.com
Cc:	joern@...fs.org, yongjun_wei@...ndmicro.com.cn,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mtd: fix possible memory leak in
 logfs_mtd_can_write_buf()

On Sun, Sep 02, 2012 at 10:19:06PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
> 
> buf has been allocated in this function and should be
> freed before leaving from the error handling case.
> 
> spatch with a semantic match is used to found this problem.
> (http://coccinelle.lip6.fr/)
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
> ---

Applied, Thanks!

>  fs/logfs/dev_mtd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/logfs/dev_mtd.c b/fs/logfs/dev_mtd.c
> index 9c50144..427bb73 100644
> --- a/fs/logfs/dev_mtd.c
> +++ b/fs/logfs/dev_mtd.c
> @@ -245,8 +245,8 @@ static int logfs_mtd_can_write_buf(struct super_block *sb, u64 ofs)
>  		goto out;
>  	if (memchr_inv(buf, 0xff, super->s_writesize))
>  		err = -EIO;
> -	kfree(buf);
>  out:
> +	kfree(buf);
>  	return err;
>  }
>  
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists