]> git.baikalelectronics.ru Git - kernel.git/commit
media: usb: stkwebcam: Update the reference count of the usb device structure
authorCai Huoqing <caihuoqing@baidu.com>
Wed, 1 Sep 2021 12:46:49 +0000 (14:46 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 30 Sep 2021 08:07:58 +0000 (10:07 +0200)
commit6308cae8a9ef814cc9cf4cf5bed7323b78a344f0
tree7911f7dac09ec6aa41bc81dfdfd50ba23f7ea6fd
parent81b00b843c407f994f87d0d0532af95f389db2e9
media: usb: stkwebcam: Update the reference count of the usb device structure

Use usb_get_dev() to increment the reference count of the usb device
structure in order to avoid releasing the structure while it is still in
use. And use usb_put_dev() to decrement the reference count and thus,
when it will be equal to 0 the structure will be released.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/stkwebcam/stk-webcam.c