linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: vimc: Remove redundant free
@ 2018-07-27 11:47 Anton Vasilyev
  2018-07-28 17:49 ` Helen Koike
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Vasilyev @ 2018-07-27 11:47 UTC (permalink / raw)
  To: Helen Koike
  Cc: Anton Vasilyev, Mauro Carvalho Chehab, linux-media, linux-kernel,
	ldv-project

Commit 4a29b7090749 ("[media] vimc: Subdevices as modules") removes
vimc allocation from vimc_probe(), so corresponding deallocation
on the error path tries to free static memory.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
---
 drivers/media/platform/vimc/vimc-core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c
index fe088a953860..9246f265de31 100644
--- a/drivers/media/platform/vimc/vimc-core.c
+++ b/drivers/media/platform/vimc/vimc-core.c
@@ -328,7 +328,6 @@ static int vimc_probe(struct platform_device *pdev)
 	if (ret) {
 		media_device_cleanup(&vimc->mdev);
 		vimc_rm_subdevs(vimc);
-		kfree(vimc);
 		return ret;
 	}
 
-- 
2.18.0


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

* Re: [PATCH] media: vimc: Remove redundant free
  2018-07-27 11:47 [PATCH] media: vimc: Remove redundant free Anton Vasilyev
@ 2018-07-28 17:49 ` Helen Koike
  0 siblings, 0 replies; 2+ messages in thread
From: Helen Koike @ 2018-07-28 17:49 UTC (permalink / raw)
  To: Anton Vasilyev
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, ldv-project

Hi Anton,

Thanks for the patch

On 07/27/2018 08:47 AM, Anton Vasilyev wrote:
> Commit 4a29b7090749 ("[media] vimc: Subdevices as modules") removes
> vimc allocation from vimc_probe(), so corresponding deallocation
> on the error path tries to free static memory.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>

Acked-by: Helen Koike <helen.koike@collabora.com>

> ---
>  drivers/media/platform/vimc/vimc-core.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c
> index fe088a953860..9246f265de31 100644
> --- a/drivers/media/platform/vimc/vimc-core.c
> +++ b/drivers/media/platform/vimc/vimc-core.c
> @@ -328,7 +328,6 @@ static int vimc_probe(struct platform_device *pdev)
>  	if (ret) {
>  		media_device_cleanup(&vimc->mdev);
>  		vimc_rm_subdevs(vimc);
> -		kfree(vimc);
>  		return ret;
>  	}
>  
> 

Regards,
Helen

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

end of thread, other threads:[~2018-07-28 17:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27 11:47 [PATCH] media: vimc: Remove redundant free Anton Vasilyev
2018-07-28 17:49 ` Helen Koike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).