lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 5 Nov 2021 19:29:47 +0100
From:   Benjamin Tissoires <benjamin.tissoires@...hat.com>
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>
Cc:     Jiri Kosina <jikos@...nel.org>,
        "open list:HID CORE LAYER" <linux-input@...r.kernel.org>,
        lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] HID: ite: Add parse before start

Hi Jiasheng,

On Thu, Nov 4, 2021 at 9:08 AM Jiasheng Jiang <jiasheng@...as.ac.cn> wrote:
>
> It might be better to add  hid_parse() before
> wacom_parse_and_register() to ask for the report descriptor.

seems like a copy/paste error when working on 2 different drivers.

>
> Fixes: 3c785a0 ("HID: ite: Replace ABS_MISC 120/121 events with touchpad on/off keypresses")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
>  drivers/hid/hid-ite.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/hid/hid-ite.c b/drivers/hid/hid-ite.c
> index 14fc068..3c56f75 100644
> --- a/drivers/hid/hid-ite.c
> +++ b/drivers/hid/hid-ite.c
> @@ -100,6 +100,10 @@ static int ite_probe(struct hid_device *hdev, const struct hid_device_id *id)
>         if (ret)
>                 return ret;
>
> +       ret = hid_parse(hdev);

hid_parse() is an inline definition of hid_open_report() which is
called just above.
So here you are asking to call the same code twice, which is suboptimal.

Cheers,
Benjamin

> +       if (ret)
> +               return ret;
> +
>         return hid_hw_start(hdev, HID_CONNECT_DEFAULT);
>  }
>
> --
> 2.7.4
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ