From: sashiko-bot@kernel.org
To: "Elliot Douglas" <edouglas7358@gmail.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH v3 2/2] HID: logitech-hidpp: enable reprogrammable buttons on Signature M650
Date: Wed, 12 Aug 2026 20:14:08 +0000 [thread overview]
Message-ID: <20260812201408.6AA091F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812195842.77724-3-edouglas7358@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing cancellation of `reset_hi_res_work` in `hidpp_probe()` error path.
--
--- Patch [2]: [PATCH v3 2/2] HID: logitech-hidpp: enable reprogrammable buttons on Signature M650 ---
commit 21d2c84d622f6c1b7cd8dfbe446bc728f3b8bf10
Author: Elliot Douglas <edouglas7358@gmail.com>
HID: logitech-hidpp: enable reprogrammable buttons on Signature M650
This patch enables reprogrammable buttons on the Signature M650 mouse over
Bluetooth. It handles the short click-like events emitted for side buttons
by using HID++ REPROG_CONTROLS_V4 diversion to provide real press and
release timing. The diverted controls are reported as BTN_BACK and
BTN_FORWARD.
Link: https://support.logi.com/hc/en-nz/articles/4414473810583-Getting-Started-Signature-M650
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
[ ... ]
> diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
> --- a/drivers/hid/hid-logitech-hidpp.c
> +++ b/drivers/hid/hid-logitech-hidpp.c
[ ... ]
While reviewing this file, I noticed a pre-existing issue in hidpp_probe():
> hid_hw_start_fail:
> sysfs_remove_group(&hdev->dev.kobj, &ps_attribute_group);
> cancel_work_sync(&hidpp->work);
> mutex_destroy(&hidpp->send_mutex);
> return ret;
[Severity: High]
This is a pre-existing issue, but does this error path need to cancel
reset_hi_res_work?
During hidpp_probe(), hid_device_io_start() is called, which enables
incoming packets. If a device with the HIDPP_QUIRK_RESET_HI_RES_SCROLL
quirk sends a battery event before the probe finishes, the event handler
can call:
schedule_work(&hidpp->reset_hi_res_work);
If a subsequent operation fails and the code branches to hid_hw_start_fail,
it cancels hidpp->work but does not cancel hidpp->reset_hi_res_work.
Since devres automatically frees the hidpp_device struct when probe()
returns, can this pending work item execute hidpp_reset_hi_res_handler()
and cause a use-after-free when it dereferences the freed memory?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260812195842.77724-1-edouglas7358@gmail.com?part=2
prev parent reply other threads:[~2026-08-12 20:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 19:58 [PATCH v3 0/2] HID: logitech-hidpp: fix Signature M650 side button timing Elliot Douglas
2026-08-12 19:58 ` [PATCH v3 1/2] HID: logitech-hidpp: add HID++ 2.0 reprogrammable button support Elliot Douglas
2026-08-12 20:13 ` sashiko-bot
2026-08-12 22:26 ` Bastien Nocera
2026-08-12 19:58 ` [PATCH v3 2/2] HID: logitech-hidpp: enable reprogrammable buttons on Signature M650 Elliot Douglas
2026-08-12 20:14 ` sashiko-bot [this message]
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=20260812201408.6AA091F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=edouglas7358@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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