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)
commit538314dbfc8adbe8af64a13c9f14e907a0a887fb
tree7911f7dac09ec6aa41bc81dfdfd50ba23f7ea6fd
parentaea54c13488575ccd1b32dde2e057ea36eed123d
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