All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] mmc: debugfs: Fix file release memory leak
@ 2022-06-08  9:01 Wei Yongjun
  2022-06-08 14:28 ` Adrian Hunter
  2022-06-15 17:32 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2022-06-08  9:01 UTC (permalink / raw)
  To: weiyongjun1, Ulf Hansson, Liangliang Lu, Adrian Hunter,
	Bao D. Nguyen, Sayali Lokhande, Shaik Sajida Bhanu, Wolfram Sang
  Cc: linux-mmc, kernel-janitors, Hulk Robot

When using single_open() for opening, single_release() should be
used instead of seq_release(), otherwise there is a memory leak.

Fixes: c835a6debf06 ("mmc: debugfs: Add debug fs entry for mmc driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.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 75e98ec88fb9..fe6808771bc7 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -295,6 +295,7 @@ static const struct file_operations mmc_err_stats_fops = {
 	.open	= mmc_err_stats_open,
 	.read	= seq_read,
 	.write	= mmc_err_stats_write,
+	.release = single_release,
 };
 
 void mmc_add_host_debugfs(struct mmc_host *host)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] mmc: debugfs: Fix file release memory leak
  2022-06-08  9:01 [PATCH -next] mmc: debugfs: Fix file release memory leak Wei Yongjun
@ 2022-06-08 14:28 ` Adrian Hunter
  2022-06-15 17:32 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Adrian Hunter @ 2022-06-08 14:28 UTC (permalink / raw)
  To: Wei Yongjun, Ulf Hansson, Liangliang Lu, Bao D. Nguyen,
	Sayali Lokhande, Shaik Sajida Bhanu, Wolfram Sang
  Cc: linux-mmc, kernel-janitors, Hulk Robot

On 8/06/22 12:01, Wei Yongjun wrote:
> When using single_open() for opening, single_release() should be
> used instead of seq_release(), otherwise there is a memory leak.
> 
> Fixes: c835a6debf06 ("mmc: debugfs: Add debug fs entry for mmc driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.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 75e98ec88fb9..fe6808771bc7 100644
> --- a/drivers/mmc/core/debugfs.c
> +++ b/drivers/mmc/core/debugfs.c
> @@ -295,6 +295,7 @@ static const struct file_operations mmc_err_stats_fops = {
>  	.open	= mmc_err_stats_open,
>  	.read	= seq_read,
>  	.write	= mmc_err_stats_write,
> +	.release = single_release,
>  };
>  
>  void mmc_add_host_debugfs(struct mmc_host *host)
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] mmc: debugfs: Fix file release memory leak
  2022-06-08  9:01 [PATCH -next] mmc: debugfs: Fix file release memory leak Wei Yongjun
  2022-06-08 14:28 ` Adrian Hunter
@ 2022-06-15 17:32 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2022-06-15 17:32 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Liangliang Lu, Adrian Hunter, Bao D. Nguyen, Sayali Lokhande,
	Shaik Sajida Bhanu, Wolfram Sang, linux-mmc, kernel-janitors,
	Hulk Robot

On Wed, 8 Jun 2022 at 01:43, Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> When using single_open() for opening, single_release() should be
> used instead of seq_release(), otherwise there is a memory leak.
>
> Fixes: c835a6debf06 ("mmc: debugfs: Add debug fs entry for mmc driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  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 75e98ec88fb9..fe6808771bc7 100644
> --- a/drivers/mmc/core/debugfs.c
> +++ b/drivers/mmc/core/debugfs.c
> @@ -295,6 +295,7 @@ static const struct file_operations mmc_err_stats_fops = {
>         .open   = mmc_err_stats_open,
>         .read   = seq_read,
>         .write  = mmc_err_stats_write,
> +       .release = single_release,
>  };
>
>  void mmc_add_host_debugfs(struct mmc_host *host)
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-15 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08  9:01 [PATCH -next] mmc: debugfs: Fix file release memory leak Wei Yongjun
2022-06-08 14:28 ` Adrian Hunter
2022-06-15 17:32 ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.