diff mbox series

media: imx-jpeg: Fix double free in mxc_jpeg_remove

Message ID 20210406173428.19283-1-mirela.rabulea@oss.nxp.com (mailing list archive)
State New, archived
Headers show
Series media: imx-jpeg: Fix double free in mxc_jpeg_remove | expand

Commit Message

Mirela Rabulea OSS April 6, 2021, 5:34 p.m. UTC
From: Mirela Rabulea <mirela.rabulea@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@nxp.com>
---
 drivers/media/platform/imx-jpeg/mxc-jpeg.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox series

Patch

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