Skip to content

Commit

Permalink
media: platform: fix some double free in meson-ge2d and mtk-jpeg and …
Browse files Browse the repository at this point in the history
…s5p-mfc

video_unregister_device will release device internally. There is no need to
call video_device_release after video_unregister_device.

Signed-off-by: Hangyu Hua <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
HBh25Y authored and mchehab committed Aug 30, 2022
1 parent 61c2698 commit c65c3f3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion drivers/media/platform/amlogic/meson-ge2d/ge2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,6 @@ static int ge2d_remove(struct platform_device *pdev)

video_unregister_device(ge2d->vfd);
v4l2_m2m_release(ge2d->m2m_dev);
video_device_release(ge2d->vfd);
v4l2_device_unregister(&ge2d->v4l2_dev);
clk_disable_unprepare(ge2d->clk);

Expand Down
1 change: 0 additions & 1 deletion drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,6 @@ static int mtk_jpeg_remove(struct platform_device *pdev)

pm_runtime_disable(&pdev->dev);
video_unregister_device(jpeg->vdev);
video_device_release(jpeg->vdev);
v4l2_m2m_release(jpeg->m2m_dev);
v4l2_device_unregister(&jpeg->v4l2_dev);

Expand Down
3 changes: 1 addition & 2 deletions drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,7 @@ static int s5p_mfc_probe(struct platform_device *pdev)
/* Deinit MFC if probe had failed */
err_enc_reg:
video_unregister_device(dev->vfd_dec);
dev->vfd_dec = NULL;
err_dec_reg:
video_device_release(dev->vfd_enc);
err_enc_alloc:
Expand Down Expand Up @@ -1444,8 +1445,6 @@ static int s5p_mfc_remove(struct platform_device *pdev)

video_unregister_device(dev->vfd_enc);
video_unregister_device(dev->vfd_dec);
video_device_release(dev->vfd_enc);
video_device_release(dev->vfd_dec);
v4l2_device_unregister(&dev->v4l2_dev);
s5p_mfc_unconfigure_dma_memory(dev);

Expand Down

0 comments on commit c65c3f3

Please sign in to comment.