Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70119756 authored by Hangyu Hua's avatar Hangyu Hua Committed by Greg Kroah-Hartman
Browse files

media: meson: vdec: fix possible refcount leak in vdec_probe()



[ Upstream commit 7718999356234d9cc6a11b4641bb773928f1390f ]

v4l2_device_unregister need to be called to put the refcount got by
v4l2_device_register when vdec_probe fails or vdec_remove is called.

Signed-off-by: default avatarHangyu Hua <hbh25y@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent bfa8ccf7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1074,6 +1074,7 @@ static int vdec_probe(struct platform_device *pdev)

err_vdev_release:
	video_device_release(vdev);
	v4l2_device_unregister(&core->v4l2_dev);
	return ret;
}

@@ -1082,6 +1083,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;
}