diff options
author | Philipp Zabel <philipp.zabel@gmail.com> | 2018-05-21 13:24:58 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-04 16:52:47 +0300 |
commit | e75194d294421704baf4c577e504cb9c92ec7ce2 (patch) | |
tree | 131da2e4ba4c3220d0fd931f98be33e1aebc76c2 /sound/usb | |
parent | cdb44bdafc3a846aa785102f65a26762fbe32037 (diff) | |
download | linux-e75194d294421704baf4c577e504cb9c92ec7ce2.tar.xz |
media: uvcvideo: Fix driver reference counting
commit f9ffcb0a21e1fa8e64d09ed613d884e054ae8191 upstream
kref_init initializes the reference count to 1, not 0. This additional
reference is never released since the conversion to reference counters.
As a result, uvc_delete is not called anymore when UVC cameras are
disconnected.
Fix this by adding an additional kref_put in uvc_disconnect and in the
probe error path. This also allows to remove the temporary additional
reference in uvc_unregister_video.
Fixes: 9d15cd958c17 ("media: uvcvideo: Convert from using an atomic variable to a reference count")
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/usb')
0 files changed, 0 insertions, 0 deletions