From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Yunke Cao <yunkec@google.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Daniel Scally <dan.scally@ideasonboard.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
Tomasz Figa <tfiga@chromium.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Ricardo Ribalda <ribalda@chromium.org>,
linux-media@vger.kernel.org, Yunke Cao <yunkec@google.com>
Subject: Re: [PATCH v14 05/11] media: uvcvideo: Add support for compound controls
Date: Wed, 6 Dec 2023 08:45:08 +0300 [thread overview]
Message-ID: <bc566008-e43c-4a74-a0c3-4ea76d599ff0@suswa.mountain> (raw)
In-Reply-To: <20231201071907.3080126-6-yunkec@google.com>
Hi Yunke,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Yunke-Cao/media-v4l2_ctrl-Add-V4L2_CTRL_TYPE_RECT/20231201-152501
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link: https://lore.kernel.org/r/20231201071907.3080126-6-yunkec%40google.com
patch subject: [PATCH v14 05/11] media: uvcvideo: Add support for compound controls
config: powerpc64-randconfig-r081-20231204 (https://download.01.org/0day-ci/archive/20231206/202312060523.tldbovNM-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231206/202312060523.tldbovNM-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202312060523.tldbovNM-lkp@intel.com/
smatch warnings:
drivers/media/usb/uvc/uvc_ctrl.c:2065 __uvc_ctrl_set_compound() warn: maybe return -EFAULT instead of the bytes remaining?
vim +2065 drivers/media/usb/uvc/uvc_ctrl.c
1a1a2af88920e9 Yunke Cao 2023-12-01 2040 static int __uvc_ctrl_set_compound(struct uvc_control_mapping *mapping,
1a1a2af88920e9 Yunke Cao 2023-12-01 2041 struct v4l2_ext_control *xctrl,
1a1a2af88920e9 Yunke Cao 2023-12-01 2042 struct uvc_control *ctrl)
1a1a2af88920e9 Yunke Cao 2023-12-01 2043 {
1a1a2af88920e9 Yunke Cao 2023-12-01 2044 u8 *data;
1a1a2af88920e9 Yunke Cao 2023-12-01 2045 int ret;
1a1a2af88920e9 Yunke Cao 2023-12-01 2046
1a1a2af88920e9 Yunke Cao 2023-12-01 2047 if (xctrl->size != mapping->v4l2_size / 8)
1a1a2af88920e9 Yunke Cao 2023-12-01 2048 return -EINVAL;
1a1a2af88920e9 Yunke Cao 2023-12-01 2049
1a1a2af88920e9 Yunke Cao 2023-12-01 2050 data = kmalloc(xctrl->size, GFP_KERNEL);
1a1a2af88920e9 Yunke Cao 2023-12-01 2051 if (!data)
1a1a2af88920e9 Yunke Cao 2023-12-01 2052 return -ENOMEM;
1a1a2af88920e9 Yunke Cao 2023-12-01 2053
1a1a2af88920e9 Yunke Cao 2023-12-01 2054 ret = copy_from_user(data, xctrl->ptr, xctrl->size);
copy_from_user() never returns negatives, it returns the number of bytes
remaining to be copied. This should be:
if (copy_from_user(data, xctrl->ptr, xctrl->size)) {
ret = -EFAULT;
goto out;
}
1a1a2af88920e9 Yunke Cao 2023-12-01 2055 if (ret < 0)
1a1a2af88920e9 Yunke Cao 2023-12-01 2056 goto out;
1a1a2af88920e9 Yunke Cao 2023-12-01 2057
1a1a2af88920e9 Yunke Cao 2023-12-01 2058 ret = mapping->set_compound(mapping, data,
1a1a2af88920e9 Yunke Cao 2023-12-01 2059 uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT));
1a1a2af88920e9 Yunke Cao 2023-12-01 2060
1a1a2af88920e9 Yunke Cao 2023-12-01 2061 __uvc_ctrl_get_compound(mapping, ctrl, UVC_CTRL_DATA_CURRENT, xctrl);
1a1a2af88920e9 Yunke Cao 2023-12-01 2062
1a1a2af88920e9 Yunke Cao 2023-12-01 2063 out:
1a1a2af88920e9 Yunke Cao 2023-12-01 2064 kfree(data);
1a1a2af88920e9 Yunke Cao 2023-12-01 @2065 return ret;
1a1a2af88920e9 Yunke Cao 2023-12-01 2066 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2023-12-06 5:45 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-01 7:18 [PATCH v14 00/11] Implement UVC v1.5 ROI Yunke Cao
2023-12-01 7:18 ` [PATCH v14 01/11] media: v4l2_ctrl: Add V4L2_CTRL_TYPE_RECT Yunke Cao
2023-12-01 8:35 ` Hans Verkuil
2023-12-08 13:41 ` Laurent Pinchart
2023-12-12 1:33 ` Yunke Cao
2023-12-12 1:37 ` Laurent Pinchart
2023-12-01 7:18 ` [PATCH v14 02/11] media: uvcvideo: add uvc_ctrl_get_boundary for getting default value Yunke Cao
2023-12-08 15:13 ` Laurent Pinchart
2023-12-01 7:18 ` [PATCH v14 03/11] media: uvcvideo: introduce __uvc_ctrl_get_std() Yunke Cao
2023-12-08 15:12 ` Laurent Pinchart
2023-12-01 7:18 ` [PATCH v14 04/11] media: uvcvideo: Split uvc_control_mapping.size to v4l2 and data size Yunke Cao
2023-12-08 14:15 ` Laurent Pinchart
2023-12-12 7:59 ` Yunke Cao
2023-12-18 3:17 ` Laurent Pinchart
2023-12-01 7:18 ` [PATCH v14 05/11] media: uvcvideo: Add support for compound controls Yunke Cao
2023-12-06 5:45 ` Dan Carpenter [this message]
2023-12-08 15:07 ` Laurent Pinchart
2023-12-13 7:38 ` Yunke Cao
2023-12-18 3:27 ` Laurent Pinchart
2023-12-20 2:28 ` Yunke Cao
2023-12-01 7:18 ` [PATCH v14 06/11] v4l2-ctrls: add support for V4L2_CTRL_WHICH_MIN/MAX_VAL Yunke Cao
2023-12-01 8:32 ` Hans Verkuil
2023-12-05 22:30 ` kernel test robot
2023-12-06 4:34 ` kernel test robot
2023-12-06 5:59 ` kernel test robot
2023-12-08 15:20 ` Laurent Pinchart
2023-12-13 4:06 ` Yunke Cao
2023-12-14 17:34 ` kernel test robot
2023-12-01 7:18 ` [PATCH v14 07/11] media: vivid: Add an rectangle control Yunke Cao
2023-12-01 7:18 ` [PATCH v14 08/11] media: uvcvideo: support V4L2_CTRL_WHICH_MIN/MAX_VAL Yunke Cao
2023-12-08 15:26 ` Laurent Pinchart
2023-12-01 7:19 ` [PATCH v14 09/11] media: uvcvideo: implement UVC v1.5 ROI Yunke Cao
2023-12-08 15:43 ` Laurent Pinchart
2024-03-14 13:24 ` Gergo Koteles
2023-12-01 7:19 ` [PATCH v14 10/11] media: uvcvideo: initilaize ROI control to default value Yunke Cao
2023-12-08 15:50 ` Laurent Pinchart
2023-12-01 7:19 ` [PATCH v14 11/11] media: uvcvideo: document UVC v1.5 ROI Yunke Cao
2023-12-08 16:00 ` Laurent Pinchart
2023-12-12 4:45 ` Yunke Cao
2023-12-18 3:44 ` Laurent Pinchart
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=bc566008-e43c-4a74-a0c3-4ea76d599ff0@suswa.mountain \
--to=dan.carpenter@linaro.org \
--cc=dan.scally@ideasonboard.com \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=ribalda@chromium.org \
--cc=senozhatsky@chromium.org \
--cc=tfiga@chromium.org \
--cc=yunkec@google.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox