All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] ASoC: SOF: debug: fix possible memory leak in sof_dfsentry_write()
@ 2019-07-05  8:16 ` Wei Yongjun
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Yongjun @ 2019-07-05  8:16 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Pierre-Louis Bossart, Ranjani Sridharan, Pan Xiuli
  Cc: Wei Yongjun, alsa-devel, linux-kernel, kernel-janitors

'string' is malloced in sof_dfsentry_write() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: 091c12e1f50c ("ASoC: SOF: debug: add new debugfs entries for IPC flood test")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 sound/soc/sof/debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c
index 54bb53bfc81b..2388477a965e 100644
--- a/sound/soc/sof/debug.c
+++ b/sound/soc/sof/debug.c
@@ -162,7 +162,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
 	else
 		ret = kstrtoul(string, 0, &ipc_count);
 	if (ret < 0)
-		return ret;
+		goto out;
 
 	/* limit max duration/ipc count for flood test */
 	if (flood_duration_test) {
@@ -191,7 +191,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
 				    "error: debugfs write failed to resume %d\n",
 				    ret);
 		pm_runtime_put_noidle(sdev->dev);
-		return ret;
+		goto out;
 	}
 
 	/* flood test */




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

* [PATCH -next] ASoC: SOF: debug: fix possible memory leak in sof_dfsentry_write()
@ 2019-07-05  8:16 ` Wei Yongjun
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Yongjun @ 2019-07-05  8:16 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Pierre-Louis Bossart, Ranjani Sridharan, Pan Xiuli
  Cc: Wei Yongjun, alsa-devel, linux-kernel, kernel-janitors

'string' is malloced in sof_dfsentry_write() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: 091c12e1f50c ("ASoC: SOF: debug: add new debugfs entries for IPC flood test")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 sound/soc/sof/debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c
index 54bb53bfc81b..2388477a965e 100644
--- a/sound/soc/sof/debug.c
+++ b/sound/soc/sof/debug.c
@@ -162,7 +162,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
 	else
 		ret = kstrtoul(string, 0, &ipc_count);
 	if (ret < 0)
-		return ret;
+		goto out;
 
 	/* limit max duration/ipc count for flood test */
 	if (flood_duration_test) {
@@ -191,7 +191,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
 				    "error: debugfs write failed to resume %d\n",
 				    ret);
 		pm_runtime_put_noidle(sdev->dev);
-		return ret;
+		goto out;
 	}
 
 	/* flood test */

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

* [PATCH -next] ASoC: SOF: debug: fix possible memory leak in sof_dfsentry_write()
@ 2019-07-05  8:16 ` Wei Yongjun
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Yongjun @ 2019-07-05  8:16 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Pierre-Louis Bossart, Ranjani Sridharan, Pan Xiuli
  Cc: Wei Yongjun, alsa-devel, linux-kernel, kernel-janitors

'string' is malloced in sof_dfsentry_write() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: 091c12e1f50c ("ASoC: SOF: debug: add new debugfs entries for IPC flood test")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 sound/soc/sof/debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c
index 54bb53bfc81b..2388477a965e 100644
--- a/sound/soc/sof/debug.c
+++ b/sound/soc/sof/debug.c
@@ -162,7 +162,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
 	else
 		ret = kstrtoul(string, 0, &ipc_count);
 	if (ret < 0)
-		return ret;
+		goto out;
 
 	/* limit max duration/ipc count for flood test */
 	if (flood_duration_test) {
@@ -191,7 +191,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
 				    "error: debugfs write failed to resume %d\n",
 				    ret);
 		pm_runtime_put_noidle(sdev->dev);
-		return ret;
+		goto out;
 	}
 
 	/* flood test */

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

* Re: [alsa-devel] [PATCH -next] ASoC: SOF: debug: fix possible memory leak in sof_dfsentry_write()
  2019-07-05  8:16 ` Wei Yongjun
@ 2019-07-05 16:37   ` Ranjani Sridharan
  -1 siblings, 0 replies; 8+ messages in thread
From: Ranjani Sridharan @ 2019-07-05 16:37 UTC (permalink / raw)
  To: Wei Yongjun, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Pierre-Louis Bossart, Pan Xiuli
  Cc: kernel-janitors, alsa-devel, linux-kernel

On Fri, 2019-07-05 at 08:16 +0000, Wei Yongjun wrote:
> 'string' is malloced in sof_dfsentry_write() and should be freed
> before leaving from the error handling cases, otherwise it will cause
> memory leak.
> 
> Fixes: 091c12e1f50c ("ASoC: SOF: debug: add new debugfs entries for
> IPC flood test")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Thanks for fixing this, Wei!
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>

> ---
>  sound/soc/sof/debug.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c
> index 54bb53bfc81b..2388477a965e 100644
> --- a/sound/soc/sof/debug.c
> +++ b/sound/soc/sof/debug.c
> @@ -162,7 +162,7 @@ static ssize_t sof_dfsentry_write(struct file
> *file, const char __user *buffer,
>  	else
>  		ret = kstrtoul(string, 0, &ipc_count);
>  	if (ret < 0)
> -		return ret;
> +		goto out;
>  
>  	/* limit max duration/ipc count for flood test */
>  	if (flood_duration_test) {
> @@ -191,7 +191,7 @@ static ssize_t sof_dfsentry_write(struct file
> *file, const char __user *buffer,
>  				    "error: debugfs write failed to
> resume %d\n",
>  				    ret);
>  		pm_runtime_put_noidle(sdev->dev);
> -		return ret;
> +		goto out;
>  	}
>  
>  	/* flood test */
> 
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel


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

* Re: [alsa-devel] [PATCH -next] ASoC: SOF: debug: fix possible memory leak in sof_dfsentry_write()
@ 2019-07-05 16:37   ` Ranjani Sridharan
  0 siblings, 0 replies; 8+ messages in thread
From: Ranjani Sridharan @ 2019-07-05 16:37 UTC (permalink / raw)
  To: Wei Yongjun, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Pierre-Louis Bossart, Pan Xiuli
  Cc: kernel-janitors, alsa-devel, linux-kernel

On Fri, 2019-07-05 at 08:16 +0000, Wei Yongjun wrote:
> 'string' is malloced in sof_dfsentry_write() and should be freed
> before leaving from the error handling cases, otherwise it will cause
> memory leak.
> 
> Fixes: 091c12e1f50c ("ASoC: SOF: debug: add new debugfs entries for
> IPC flood test")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Thanks for fixing this, Wei!
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>

> ---
>  sound/soc/sof/debug.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c
> index 54bb53bfc81b..2388477a965e 100644
> --- a/sound/soc/sof/debug.c
> +++ b/sound/soc/sof/debug.c
> @@ -162,7 +162,7 @@ static ssize_t sof_dfsentry_write(struct file
> *file, const char __user *buffer,
>  	else
>  		ret = kstrtoul(string, 0, &ipc_count);
>  	if (ret < 0)
> -		return ret;
> +		goto out;
>  
>  	/* limit max duration/ipc count for flood test */
>  	if (flood_duration_test) {
> @@ -191,7 +191,7 @@ static ssize_t sof_dfsentry_write(struct file
> *file, const char __user *buffer,
>  				    "error: debugfs write failed to
> resume %d\n",
>  				    ret);
>  		pm_runtime_put_noidle(sdev->dev);
> -		return ret;
> +		goto out;
>  	}
>  
>  	/* flood test */
> 
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Applied "ASoC: SOF: debug: fix possible memory leak in sof_dfsentry_write()" to the asoc tree
  2019-07-05  8:16 ` Wei Yongjun
  (?)
@ 2019-07-05 17:19   ` Mark Brown
  -1 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2019-07-05 17:19 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: alsa-devel, Jaroslav Kysela, kernel-janitors, Liam Girdwood,
	linux-kernel, Mark Brown, Pan Xiuli, Pierre-Louis Bossart,
	Ranjani Sridharan, Takashi Iwai

The patch

   ASoC: SOF: debug: fix possible memory leak in sof_dfsentry_write()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From b90bab3b1b1b6c56dd6f9d5c960932239f36f6d3 Mon Sep 17 00:00:00 2001
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Fri, 5 Jul 2019 08:16:37 +0000
Subject: [PATCH] ASoC: SOF: debug: fix possible memory leak in
 sof_dfsentry_write()

'string' is malloced in sof_dfsentry_write() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: 091c12e1f50c ("ASoC: SOF: debug: add new debugfs entries for IPC flood test")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20190705081637.157169-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sof/debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c
index 54bb53bfc81b..2388477a965e 100644
--- a/sound/soc/sof/debug.c
+++ b/sound/soc/sof/debug.c
@@ -162,7 +162,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
 	else
 		ret = kstrtoul(string, 0, &ipc_count);
 	if (ret < 0)
-		return ret;
+		goto out;
 
 	/* limit max duration/ipc count for flood test */
 	if (flood_duration_test) {
@@ -191,7 +191,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
 				    "error: debugfs write failed to resume %d\n",
 				    ret);
 		pm_runtime_put_noidle(sdev->dev);
-		return ret;
+		goto out;
 	}
 
 	/* flood test */
-- 
2.20.1


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

* Applied "ASoC: SOF: debug: fix possible memory leak in sof_dfsentry_write()" to the asoc tree
@ 2019-07-05 17:19   ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2019-07-05 17:19 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: alsa-devel, Jaroslav Kysela, kernel-janitors, Liam Girdwood,
	linux-kernel, Mark Brown, Pan Xiuli, Pierre-Louis Bossart,
	Ranjani Sridharan, Takashi Iwai

The patch

   ASoC: SOF: debug: fix possible memory leak in sof_dfsentry_write()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From b90bab3b1b1b6c56dd6f9d5c960932239f36f6d3 Mon Sep 17 00:00:00 2001
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Fri, 5 Jul 2019 08:16:37 +0000
Subject: [PATCH] ASoC: SOF: debug: fix possible memory leak in
 sof_dfsentry_write()

'string' is malloced in sof_dfsentry_write() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: 091c12e1f50c ("ASoC: SOF: debug: add new debugfs entries for IPC flood test")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20190705081637.157169-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sof/debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c
index 54bb53bfc81b..2388477a965e 100644
--- a/sound/soc/sof/debug.c
+++ b/sound/soc/sof/debug.c
@@ -162,7 +162,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
 	else
 		ret = kstrtoul(string, 0, &ipc_count);
 	if (ret < 0)
-		return ret;
+		goto out;
 
 	/* limit max duration/ipc count for flood test */
 	if (flood_duration_test) {
@@ -191,7 +191,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
 				    "error: debugfs write failed to resume %d\n",
 				    ret);
 		pm_runtime_put_noidle(sdev->dev);
-		return ret;
+		goto out;
 	}
 
 	/* flood test */
-- 
2.20.1

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

* Applied "ASoC: SOF: debug: fix possible memory leak in sof_dfsentry_write()" to the asoc tree
@ 2019-07-05 17:19   ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2019-07-05 17:19 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: alsa-devel, Jaroslav Kysela, kernel-janitors, Liam Girdwood,
	linux-kernel, Mark Brown, Pan Xiuli, Pierre-Louis Bossart,
	Ranjani Sridharan, Takashi Iwai

The patch

   ASoC: SOF: debug: fix possible memory leak in sof_dfsentry_write()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From b90bab3b1b1b6c56dd6f9d5c960932239f36f6d3 Mon Sep 17 00:00:00 2001
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Fri, 5 Jul 2019 08:16:37 +0000
Subject: [PATCH] ASoC: SOF: debug: fix possible memory leak in
 sof_dfsentry_write()

'string' is malloced in sof_dfsentry_write() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: 091c12e1f50c ("ASoC: SOF: debug: add new debugfs entries for IPC flood test")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20190705081637.157169-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sof/debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c
index 54bb53bfc81b..2388477a965e 100644
--- a/sound/soc/sof/debug.c
+++ b/sound/soc/sof/debug.c
@@ -162,7 +162,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
 	else
 		ret = kstrtoul(string, 0, &ipc_count);
 	if (ret < 0)
-		return ret;
+		goto out;
 
 	/* limit max duration/ipc count for flood test */
 	if (flood_duration_test) {
@@ -191,7 +191,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
 				    "error: debugfs write failed to resume %d\n",
 				    ret);
 		pm_runtime_put_noidle(sdev->dev);
-		return ret;
+		goto out;
 	}
 
 	/* flood test */
-- 
2.20.1

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

end of thread, other threads:[~2019-07-05 17:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-05  8:16 [PATCH -next] ASoC: SOF: debug: fix possible memory leak in sof_dfsentry_write() Wei Yongjun
2019-07-05  8:16 ` Wei Yongjun
2019-07-05  8:16 ` Wei Yongjun
2019-07-05 16:37 ` [alsa-devel] " Ranjani Sridharan
2019-07-05 16:37   ` Ranjani Sridharan
2019-07-05 17:19 ` Applied "ASoC: SOF: debug: fix possible memory leak in sof_dfsentry_write()" to the asoc tree Mark Brown
2019-07-05 17:19   ` Mark Brown
2019-07-05 17:19   ` Mark Brown

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.