diff mbox series

media: vimc: Remove redundant free

Message ID 20180727114759.10601-1-vasilyev@ispras.ru (mailing list archive)
State New, archived
Headers show
Series media: vimc: Remove redundant free | expand

Commit Message

Anton Vasilyev July 27, 2018, 11:47 a.m. UTC
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(-)

Comments

Helen Mae Koike Fornazier July 28, 2018, 5:49 p.m. UTC | #1
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
diff mbox series

Patch

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;
 	}