All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH v6 6/7] usb: gadget: uvc: add VIDIOC function
Date: Sun, 09 Jan 2022 02:23:26 +0800	[thread overview]
Message-ID: <202201090204.9HpxUP5B-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 7943 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20220105115527.3592860-7-m.grzeschik@pengutronix.de>
References: <20220105115527.3592860-7-m.grzeschik@pengutronix.de>
TO: Michael Grzeschik <m.grzeschik@pengutronix.de>

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/202201090204.9HpxUP5B-lkp(a)intel.com/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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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/kbuild-all(a)lists.01.org

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v6 6/7] usb: gadget: uvc: add VIDIOC function
Date: Mon, 10 Jan 2022 10:04:08 +0300	[thread overview]
Message-ID: <202201090204.9HpxUP5B-lkp@intel.com> (raw)
In-Reply-To: <20220105115527.3592860-7-m.grzeschik@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 7192 bytes --]

Hi Michael,

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
config: i386-randconfig-m021-20220107 (https://download.01.org/0day-ci/archive/20220109/202201090204.9HpxUP5B-lkp(a)intel.com/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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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

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);

take 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);

unlock before returning

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);

Same

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);

Same

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);

Same

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  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

             reply	other threads:[~2022-01-08 18:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-08 18:23 kernel test robot [this message]
2022-01-10  7:04 ` [PATCH v6 6/7] usb: gadget: uvc: add VIDIOC function Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2022-01-05 11:55 [PATCH v6 0/7] usb: gadget: uvc: use configfs entries for negotiation and v4l2 VIDIOCS Michael Grzeschik
2022-01-05 11:55 ` [PATCH v6 1/7] media: v4l: move helper functions for fractions from uvc to v4l2-common Michael Grzeschik
2022-03-15 14:25   ` Greg KH
2022-03-15 14:36     ` Michael Grzeschik
2022-01-05 11:55 ` [PATCH v6 2/7] media: uvcvideo: move uvc_format_desc to common header Michael Grzeschik
2022-01-05 11:55 ` [PATCH v6 3/7] usb: gadget: uvc: prevent index variables to start from 0 Michael Grzeschik
2022-01-05 11:55 ` [PATCH v6 4/7] usb: gadget: uvc: move structs to common header Michael Grzeschik
2022-01-05 11:55 ` [PATCH v6 5/7] usb: gadget: uvc: track frames in format entries Michael Grzeschik
2022-01-05 11:55 ` [PATCH v6 6/7] usb: gadget: uvc: add VIDIOC function Michael Grzeschik
2022-01-05 11:55 ` [PATCH v6 7/7] usb: gadget: uvc: add format/frame handling code Michael Grzeschik
2022-01-06 22:23 ` [PATCH v6 0/7] usb: gadget: uvc: use configfs entries for negotiation and v4l2 VIDIOCS Michael Grzeschik
2022-01-07  9:24   ` Kieran Bingham
2022-01-26 13:22     ` [PATCH] dummy_hcd: add isoc support Michael Grzeschik
2022-01-26 16:09       ` Alan Stern
2022-01-26 18:31         ` Michael Grzeschik
2022-01-31 12:08           ` Kieran Bingham
2022-01-31 12:43             ` Greg KH
2022-01-31 15:32             ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202201090204.9HpxUP5B-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.