From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Greg KH <greg@kroah.com>, Jiri Kosina <jikos@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
Tero Kristo <tero.kristo@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-doc@vger.kernel.org,
Benjamin Tissoires <benjamin.tissoires@redhat.com>
Subject: Re: [PATCH hid v11 07/14] HID: bpf: introduce hid_hw_request()
Date: Wed, 2 Nov 2022 15:11:43 +0300 [thread overview]
Message-ID: <202210291931.zGXW0epb-lkp@intel.com> (raw)
In-Reply-To: <20221025093458.457089-8-benjamin.tissoires@redhat.com>
Hi Benjamin,
url: https://github.com/intel-lab-lkp/linux/commits/Benjamin-Tissoires/Introduce-eBPF-support-for-HID-devices/20221025-173852
base: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git master
patch link: https://lore.kernel.org/r/20221025093458.457089-8-benjamin.tissoires%40redhat.com
patch subject: [PATCH hid v11 07/14] HID: bpf: introduce hid_hw_request()
config: riscv-randconfig-m041-20221029
compiler: riscv32-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
smatch warnings:
drivers/hid/bpf/hid_bpf_dispatch.c:297 hid_bpf_hw_request() warn: variable dereferenced before check 'ctx' (see line 289)
vim +/ctx +297 drivers/hid/bpf/hid_bpf_dispatch.c
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 285 noinline int
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 286 hid_bpf_hw_request(struct hid_bpf_ctx *ctx, __u8 *buf, size_t buf__sz,
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 287 enum hid_report_type rtype, enum hid_class_request reqtype)
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 288 {
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 @289 struct hid_device *hdev = (struct hid_device *)ctx->hid; /* discard const */
^^^^^^^^
Dereference
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 290 struct hid_report *report;
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 291 struct hid_report_enum *report_enum;
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 292 u8 *dma_data;
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 293 u32 report_len;
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 294 int ret;
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 295
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 296 /* check arguments */
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 @297 if (!ctx || !hid_bpf_ops || !buf)
^^^
Checked too late.
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 298 return -EINVAL;
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 299
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 300 switch (rtype) {
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 301 case HID_INPUT_REPORT:
eaf51f2d4f8561 Benjamin Tissoires 2022-10-25 302 case HID_OUTPUT_REPORT:
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next prev parent reply other threads:[~2022-11-02 12:11 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 9:34 [PATCH hid v11 00/14] Introduce eBPF support for HID devices Benjamin Tissoires
2022-10-25 9:34 ` [PATCH hid v11 01/14] HID: Kconfig: split HID support and hid-core compilation Benjamin Tissoires
2022-10-29 13:55 ` kernel test robot
2022-10-25 9:34 ` [PATCH hid v11 02/14] HID: initial BPF implementation Benjamin Tissoires
2022-10-25 22:52 ` Alexei Starovoitov
2022-10-27 9:11 ` Benjamin Tissoires
2022-10-25 9:34 ` [PATCH hid v11 03/14] selftests: add tests for the HID-bpf initial implementation Benjamin Tissoires
2022-10-25 9:34 ` [PATCH hid v11 04/14] HID: bpf jmp table: simplify the logic of cleaning up programs Benjamin Tissoires
2022-10-25 9:34 ` [PATCH hid v11 05/14] HID: bpf: allocate data memory for device_event BPF programs Benjamin Tissoires
2022-10-25 9:34 ` [PATCH hid v11 06/14] selftests/hid: add test to change the report size Benjamin Tissoires
2022-10-25 9:34 ` [PATCH hid v11 07/14] HID: bpf: introduce hid_hw_request() Benjamin Tissoires
2022-11-02 12:11 ` Dan Carpenter [this message]
2022-10-25 9:34 ` [PATCH hid v11 08/14] selftests/hid: add tests for bpf_hid_hw_request Benjamin Tissoires
2022-10-25 9:34 ` [PATCH hid v11 09/14] HID: bpf: allow to change the report descriptor Benjamin Tissoires
2022-10-25 9:34 ` [PATCH hid v11 10/14] selftests/hid: add report descriptor fixup tests Benjamin Tissoires
2022-10-25 9:34 ` [PATCH hid v11 11/14] selftests/hid: Add a test for BPF_F_INSERT_HEAD Benjamin Tissoires
2022-10-25 9:34 ` [PATCH hid v11 12/14] samples/hid: add new hid BPF example Benjamin Tissoires
2022-10-25 9:34 ` [PATCH hid v11 13/14] samples/hid: add Surface Dial example Benjamin Tissoires
2022-10-25 9:34 ` [PATCH hid v11 14/14] Documentation: add HID-BPF docs Benjamin Tissoires
2022-10-26 13:21 ` Bagas Sanjaya
2022-10-26 13:44 ` Jonathan Corbet
2022-11-04 11:41 ` [PATCH hid v11 00/14] Introduce eBPF support for HID devices Tero Kristo
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=202210291931.zGXW0epb-lkp@intel.com \
--to=error27@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=bpf@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=greg@kroah.com \
--cc=jikos@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=skhan@linuxfoundation.org \
--cc=tero.kristo@linux.intel.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;
as well as URLs for NNTP newsgroup(s).