CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Michael Grzeschik <[email protected]>

Hi Michael,

I love your patch! Perhaps something to improve:

[auto build test WARNING on media-tree/master]
[also build test WARNING on usb/usb-testing peter-chen-usb/for-usb-next 
v5.16-rc8 next-20220107]
[cannot apply to balbi-usb/testing/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    
https://github.com/0day-ci/linux/commits/Michael-Grzeschik/usb-gadget-uvc-use-configfs-entries-for-negotiation-and-v4l2-VIDIOCS/20220105-195807
base:   git://linuxtv.org/media_tree.git master
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: i386-randconfig-m021-20220107 
(https://download.01.org/0day-ci/archive/20220109/[email protected]/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
drivers/usb/gadget/function/f_uvc.c:983 uvc_alloc() warn: inconsistent returns 
'&opts->lock'.

vim +983 drivers/usb/gadget/function/f_uvc.c

6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  909  
4a6698b80cfe36 Fengguang Wu          2014-09-16  910  static struct 
usb_function *uvc_alloc(struct usb_function_instance *fi)
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  911  {
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  912    struct uvc_device *uvc;
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  913    struct f_uvc_opts *opts;
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  914    struct 
uvc_descriptor_header **strm_cls;
90866d89b13da2 Michael Grzeschik     2022-01-05  915    struct config_item 
*streaming, *header, *h;
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  916  
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  917    uvc = 
kzalloc(sizeof(*uvc), GFP_KERNEL);
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  918    if (uvc == NULL)
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  919            return 
ERR_PTR(-ENOMEM);
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  920  
d8e96c4bf6e3cd Hans Verkuil          2015-02-17  921    
mutex_init(&uvc->video.mutex);
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  922    uvc->state = 
UVC_STATE_DISCONNECTED;
bbea6de1bd12dd Andrzej Pietrasiewicz 2014-12-10  923    opts = 
fi_to_f_uvc_opts(fi);
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  924  
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  925    mutex_lock(&opts->lock);
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  926    if 
(opts->uvc_fs_streaming_cls) {
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  927            strm_cls = 
opts->uvc_fs_streaming_cls;
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  928            
opts->fs_streaming =
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  929                    (const 
struct uvc_descriptor_header * const *)strm_cls;
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  930    }
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  931    if 
(opts->uvc_hs_streaming_cls) {
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  932            strm_cls = 
opts->uvc_hs_streaming_cls;
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  933            
opts->hs_streaming =
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  934                    (const 
struct uvc_descriptor_header * const *)strm_cls;
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  935    }
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  936    if 
(opts->uvc_ss_streaming_cls) {
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  937            strm_cls = 
opts->uvc_ss_streaming_cls;
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  938            
opts->ss_streaming =
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  939                    (const 
struct uvc_descriptor_header * const *)strm_cls;
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  940    }
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  941  
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  942    uvc->desc.fs_control = 
opts->fs_control;
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  943    uvc->desc.ss_control = 
opts->ss_control;
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  944    uvc->desc.fs_streaming 
= opts->fs_streaming;
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  945    uvc->desc.hs_streaming 
= opts->hs_streaming;
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  946    uvc->desc.ss_streaming 
= opts->ss_streaming;
90866d89b13da2 Michael Grzeschik     2022-01-05  947  
90866d89b13da2 Michael Grzeschik     2022-01-05  948    streaming = 
config_group_find_item(&opts->func_inst.group, "streaming");
90866d89b13da2 Michael Grzeschik     2022-01-05  949    if (!streaming) {
90866d89b13da2 Michael Grzeschik     2022-01-05  950            
config_item_put(streaming);
90866d89b13da2 Michael Grzeschik     2022-01-05  951            return 
ERR_PTR(-ENOMEM);
90866d89b13da2 Michael Grzeschik     2022-01-05  952    }
90866d89b13da2 Michael Grzeschik     2022-01-05  953    header = 
config_group_find_item(to_config_group(streaming), "header");
90866d89b13da2 Michael Grzeschik     2022-01-05  954    
config_item_put(streaming);
90866d89b13da2 Michael Grzeschik     2022-01-05  955    if (!header) {
90866d89b13da2 Michael Grzeschik     2022-01-05  956            
config_item_put(header);
90866d89b13da2 Michael Grzeschik     2022-01-05  957            return 
ERR_PTR(-ENOMEM);
90866d89b13da2 Michael Grzeschik     2022-01-05  958    }
90866d89b13da2 Michael Grzeschik     2022-01-05  959    h = 
config_group_find_item(to_config_group(header), "h");
90866d89b13da2 Michael Grzeschik     2022-01-05  960    config_item_put(header);
90866d89b13da2 Michael Grzeschik     2022-01-05  961    if (!h) {
90866d89b13da2 Michael Grzeschik     2022-01-05  962            
config_item_put(h);
90866d89b13da2 Michael Grzeschik     2022-01-05  963            return 
ERR_PTR(-ENOMEM);
90866d89b13da2 Michael Grzeschik     2022-01-05  964    }
90866d89b13da2 Michael Grzeschik     2022-01-05  965    uvc->header = 
to_uvcg_streaming_header(h);
90866d89b13da2 Michael Grzeschik     2022-01-05  966    if 
(!uvc->header->linked)
90866d89b13da2 Michael Grzeschik     2022-01-05  967            return 
ERR_PTR(-EBUSY);
90866d89b13da2 Michael Grzeschik     2022-01-05  968  
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  969    ++opts->refcnt;
46919a23ee87bb Andrzej Pietrasiewicz 2014-12-10  970    
mutex_unlock(&opts->lock);
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  971  
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  972    /* Register the 
function. */
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  973    uvc->func.name = "uvc";
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  974    uvc->func.bind = 
uvc_function_bind;
e6bab2b66329b4 Michael Tretter       2021-10-17  975    uvc->func.unbind = 
uvc_function_unbind;
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  976    uvc->func.get_alt = 
uvc_function_get_alt;
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  977    uvc->func.set_alt = 
uvc_function_set_alt;
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  978    uvc->func.disable = 
uvc_function_disable;
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  979    uvc->func.setup = 
uvc_function_setup;
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  980    uvc->func.free_func = 
uvc_free;
f277bf27cf5cd5 Robert Baldyga        2015-05-04  981    
uvc->func.bind_deactivated = true;
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  982  
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09 @983    return &uvc->func;
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  984  }
6d11ed76c45dd7 Andrzej Pietrasiewicz 2014-09-09  985  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to