diff options
author | Philipp Zabel <philipp.zabel@gmail.com> | 2018-05-21 12:24:58 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-05-28 22:49:47 +0200 |
commit | f9ffcb0a21e1fa8e64d09ed613d884e054ae8191 (patch) | |
tree | 3056d7b1b874e007d756dd264691faba460530f1 /drivers/iio | |
parent | media: gspca_zc3xx: Enable short exposure times for OV7648 (diff) | |
download | linux-f9ffcb0a21e1fa8e64d09ed613d884e054ae8191.tar.xz linux-f9ffcb0a21e1fa8e64d09ed613d884e054ae8191.zip |
media: uvcvideo: Fix driver reference counting
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>
Diffstat (limited to 'drivers/iio')
0 files changed, 0 insertions, 0 deletions