lkml.org 
[lkml]   [2015]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/3] mmc: debugfs: fix memory leak for mmc_ext_csd_open
From
Date
On 2015/9/22 9:29, trick wong wrote:
> In the correct path,this buf will used later.why freed?
>

right.
sorry for this noise, withdraw this patch[1/3].

> 2015-09-22 9:18 GMT+08:00 Shawn Lin <shawn.lin@rock-chips.com
> <mailto:shawn.lin@rock-chips.com>>:
>
> buf allocated isn't been freed before return, so we fix it.
>
> Fixes: 736bb6bb01a ("mmc: Add Extended CSD register to debugfs")
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com
> <mailto:shawn.lin@rock-chips.com>>
> ---
>
> drivers/mmc/core/debugfs.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
> index e914210..b2ab936 100644
> --- a/drivers/mmc/core/debugfs.c
> +++ b/drivers/mmc/core/debugfs.c
> @@ -304,6 +304,7 @@ static int mmc_ext_csd_open(struct inode *inode,
> struct file *filp)
>
> filp->private_data = buf;
> kfree(ext_csd);
> + kfree(buf);
> return 0;
>
> out_free:
> --
> 2.3.7
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> <mailto:majordomo@vger.kernel.org>
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>


--
Best Regards
Shawn Lin



\
 
 \ /
  Last update: 2015-09-22 04:01    [W:0.110 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site