Message ID | 20230524121150.435736-4-hverkuil-cisco@xs4all.nl |
---|---|
State | Accepted |
Commit | 7cc471112edd5292a05698dd3f7b9543844a26a1 |
Headers | show |
Series | [1/8] staging: media: atomisp: initialize settings to 0 | expand |
diff --git a/drivers/media/usb/as102/as102_usb_drv.c b/drivers/media/usb/as102/as102_usb_drv.c index 50419e8ae56c..6b380144d6c2 100644 --- a/drivers/media/usb/as102/as102_usb_drv.c +++ b/drivers/media/usb/as102/as102_usb_drv.c @@ -303,10 +303,8 @@ static void as102_usb_release(struct kref *kref) struct as102_dev_t *as102_dev; as102_dev = container_of(kref, struct as102_dev_t, kref); - if (as102_dev != NULL) { - usb_put_dev(as102_dev->bus_adap.usb_dev); - kfree(as102_dev); - } + usb_put_dev(as102_dev->bus_adap.usb_dev); + kfree(as102_dev); } static void as102_usb_disconnect(struct usb_interface *intf)
Fixes this smatch warning: drivers/media/usb/as102/as102_usb_drv.c:306 as102_usb_release() warn: can 'as102_dev' even be NULL? And indeed, as102_dev can never be NULL, so just drop the NULL check. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> --- drivers/media/usb/as102/as102_usb_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)