Skip to contentSkip to conversation

media: vimc: Remove redundant free

PATCH In review Anton Vasilyev 2 participants 2 messages Jul 27, 2018 – Jul 28, 2018 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: vimc: Remove redundant free

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).

---
 drivers/media/platform/vimc/vimc-core.c | 1 -
 1 file changed, 1 deletion(-)
drivers/media/platform/vimc/vimc-core.c +0 -1
index fe088a953860..9246f265de31 100644
@@ -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;
 	}
 
Signature · 1 line
2.18.0
Acked-by on v1 1/1
#1 lore raw

Hi Anton,

Thanks for the patch

Quoted 7 lines · Anton Vasilyev

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).

Quoted 10 lines
---
 drivers/media/platform/vimc/vimc-core.c | 1 -
 1 file changed, 1 deletion(-)
drivers/media/platform/vimc/vimc-core.c +0 -0
index fe088a953860..9246f265de31 100644

drivers/media/platform/vimc/vimc-core.c static int vimc_probe(struct platform_device *pdev) · line 333

Quoted 7 lines
drivers/media/platform/vimc/vimc-core.c +0 -1
@@ -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