mirror of
https://github.com/torvalds/linux.git
synced 2026-11-10 17:11:02 +01:00
media: pvrusb2: Fix USB parent device leak in class_dev_create()
class_dev_create() stores a reference to the USB device obtained with
get_device() in class_dev->parent, which class_dev_destroy() releases.
When device_register() fails the function only drops class_dev, so the
reference to the USB parent device is never released.
Drop the parent reference on the failure path as well.
Fixes: 28c4a5e6d3 ("V4L/DVB: pvrusb2: Fix USB parent device reference count")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
ce6c6dd632
commit
02421d7278
|
|
@ -633,6 +633,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp)
|
|||
if (ret) {
|
||||
pvr2_trace(PVR2_TRACE_ERROR_LEGS,
|
||||
"device_register failed");
|
||||
put_device(class_dev->parent);
|
||||
put_device(class_dev);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user