meson: vdec: fix possible refcount leak in vdec_probe()
Subsystems (4)
PATCH 1/1 meson: vdec: fix possible refcount leak in vdec_probe()
v4l2_device_unregister need to be called to put the refount got by v4l2_device_register when vdec_probe fails or vdec_remove is called.
Signed-off-by Hangyu Hua <[email protected]>
--- drivers/staging/media/meson/vdec/vdec.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/media/meson/vdec/vdec.c +2 -0
@@ -1102,6 +1102,7 @@ static int vdec_probe(struct platform_device *pdev) err_vdev_release:video_device_release (vdev); +v4l2_device_unregister (&core->v4l2_dev);return ret; }
@@ -1110,6 +1111,7 @@ static int vdec_remove(struct platform_device *pdev)struct amvdec_core *core =platform_get_drvdata (pdev);video_unregister_device (core->vdev_dec); +v4l2_device_unregister (&core->v4l2_dev);return 0 ; }
Signature · 1 line
2.34.1