Skip to content

Commit 1eaed40

Browse files
oneukumgregkh
authored andcommitted
media: usbtv: Fix refcounting mixup
commit bf65f8a upstream. The premature free in the error path is blocked by V4L refcounting, not USB refcounting. Thanks to Ben Hutchings for review. [v2] corrected attributions Signed-off-by: Oliver Neukum <oneukum@suse.com> Fixes: 50e7044 ("media: usbtv: prevent double free in error case") CC: stable@vger.kernel.org Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a0a9121 commit 1eaed40

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/media/usb/usbtv/usbtv-core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ static int usbtv_probe(struct usb_interface *intf,
113113

114114
usbtv_audio_fail:
115115
/* we must not free at this point */
116-
usb_get_dev(usbtv->udev);
116+
v4l2_device_get(&usbtv->v4l2_dev);
117+
/* this will undo the v4l2_device_get() */
117118
usbtv_video_free(usbtv);
118119

119120
usbtv_video_fail:

0 commit comments

Comments
 (0)