commit | 4fee3299be69b42dfa1949fbf49d5c2641e6952a | [log] [tgz] |
---|---|---|
author | Philipp Zabel <[email protected]> | Mon May 21 10:24:58 2018 |
committer | ChromeOS Commit Bot <[email protected]> | Tue Nov 13 23:21:45 2018 |
tree | 85c5d2d6f22c3166b31da368988581432e20aeaa | |
parent | 155a3c462f0cdbc5a9679600ed4f45224c026a11 [diff] |
UPSTREAM: 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 <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit e75194d294421704baf4c577e504cb9c92ec7ce2) Signed-off-by: Daniel Kurtz <[email protected]> BUG=chromium:901671,b:119291953 TEST=build, boot & sanity check on grunt Change-Id: I703b0712ea6c1d9f86a7adcd295e6728db798a09 Reviewed-on: https://chromium-review.googlesource.com/c/1334449 Reviewed-by: Guenter Roeck <[email protected]> Commit-Queue: Daniel Kurtz <[email protected]> Tested-by: Daniel Kurtz <[email protected]>