[PATCH] media: imx-jpeg: Fix double free in mxc_jpeg_remove

Mirela Rabulea (OSS) mirela.rabulea at oss.nxp.com
Tue Apr 6 18:34:28 BST 2021


From: Mirela Rabulea <mirela.rabulea at nxp.com>

The video_unregister_device already calls video_device_release,
so remove video_device_release, to avoid a double free, when removing
the module. This showed up in a repeated rmmod/insmod scenario.

Signed-off-by: Mirela Rabulea <mirela.rabulea at nxp.com>
---
 drivers/media/platform/imx-jpeg/mxc-jpeg.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/imx-jpeg/mxc-jpeg.c
index 2d29558f1864..ca1b7e8c65f4 100644
--- a/drivers/media/platform/imx-jpeg/mxc-jpeg.c
+++ b/drivers/media/platform/imx-jpeg/mxc-jpeg.c
@@ -2099,7 +2099,6 @@ static int mxc_jpeg_remove(struct platform_device *pdev)
 		mxc_jpeg_free_slot_data(jpeg, slot);
 
 	video_unregister_device(jpeg->dec_vdev);
-	video_device_release(jpeg->dec_vdev);
 	v4l2_m2m_release(jpeg->m2m_dev);
 	v4l2_device_unregister(&jpeg->v4l2_dev);
 	mxc_jpeg_detach_pm_domains(jpeg);
-- 
2.17.1




More information about the linux-arm-kernel mailing list