mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
media: meson: vdec: fix possible refcount leak in vdec_probe()
[ Upstream commit 7718999356
]
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: Hangyu Hua <hbh25y@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8b785cdcd3
commit
f96ad391d0
1 changed files with 2 additions and 0 deletions
|
@ -1105,6 +1105,7 @@ static int vdec_probe(struct platform_device *pdev)
|
|||
|
||||
err_vdev_release:
|
||||
video_device_release(vdev);
|
||||
v4l2_device_unregister(&core->v4l2_dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1113,6 +1114,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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue