From: sashiko-bot@kernel.org
To: "Eliav Farber" <farbere@amazon.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH v4 06/13] platform/x86: bitland-mifs-wmi: use devm_blocking_notifier_chain_register()
Date: Sun, 26 Jul 2026 10:27:17 +0000 [thread overview]
Message-ID: <20260726102717.E691A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260726101739.33170-7-farbere@amazon.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Potential NULL pointer dereference in `bitland_mifs_wmi_notify()` when handling events for the CONTROL WMI device.
--
--- Patch [6]: [PATCH v4 06/13] platform/x86: bitland-mifs-wmi: use devm_blocking_notifier_chain_register() ---
commit b97b8d7c2a6f0ffd33788a7a075476a57a269e06
Author: Eliav Farber <farbere@amazon.com>
platform/x86: bitland-mifs-wmi: use devm_blocking_notifier_chain_register()
This commit simplifies the driver by replacing the combination of
blocking_notifier_chain_register() and devm_add_action_or_reset()
with a single call to devm_blocking_notifier_chain_register(). It
also removes the now-unused bitland_notifier_unregister() callback.
> diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
> index b0d06a80e89ef..576d6f3733b4c 100644
> --- a/drivers/platform/x86/bitland-mifs-wmi.c
> +++ b/drivers/platform/x86/bitland-mifs-wmi.c
[ ... ]
> @@ -721,13 +714,9 @@ static int bitland_mifs_wmi_probe(struct wmi_device *wdev, const void *context)
> return ret;
>
> drv_data->notifier.notifier_call = bitland_notifier_callback;
> - ret = blocking_notifier_chain_register(&bitland_notifier_list, &drv_data->notifier);
> - if (ret)
> - return ret;
> -
> - return devm_add_action_or_reset(&wdev->dev,
> - bitland_notifier_unregister,
> - &drv_data->notifier);
> + return devm_blocking_notifier_chain_register(&wdev->dev,
> + &bitland_notifier_list,
> + &drv_data->notifier);
> }
>
> static void bitland_mifs_wmi_notify(struct wmi_device *wdev,
[Severity: High]
This is a pre-existing issue, but I noticed a potential NULL pointer
dereference in the notification handler.
During bitland_mifs_wmi_probe(), data->input_dev is only allocated if the
device type is BITLAND_WMI_EVENT. However, if firmware sends a hotkey
event to the control device, bitland_mifs_wmi_notify() will run without
checking if data->input_dev is actually allocated:
bitland_mifs_wmi_notify()
...
case WMI_EVENT_OPEN_APP:
case WMI_EVENT_CALCULATOR_START:
case WMI_EVENT_BROWSER_START: {
guard(mutex)(&data->lock);
if (!sparse_keymap_report_event(data->input_dev,
event->event_id, 1, true))
Could this cause a kernel panic in sparse_keymap_report_event() since it
doesn't defensively check for a NULL input_dev?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260726101739.33170-1-farbere@amazon.com?part=6
next prev parent reply other threads:[~2026-07-26 10:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-26 10:17 [PATCH v4 00/13] notifier: add device-managed registration APIs and convert drivers Eliav Farber
2026-07-26 10:17 ` [PATCH v4 01/13] notifier: add device-managed registration APIs Eliav Farber
2026-07-26 10:17 ` [PATCH v4 02/13] pwm: iqs620a: use devm_blocking_notifier_chain_register() Eliav Farber
2026-07-26 10:17 ` [PATCH v4 03/13] iio: light: iqs621-als: " Eliav Farber
2026-07-26 10:17 ` [PATCH v4 04/13] iio: position: iqs624: " Eliav Farber
2026-07-26 10:17 ` [PATCH v4 05/13] gpio: adp5585: " Eliav Farber
2026-07-26 10:27 ` sashiko-bot
2026-07-26 10:17 ` [PATCH v4 06/13] platform/x86: bitland-mifs-wmi: " Eliav Farber
2026-07-26 10:27 ` sashiko-bot [this message]
2026-07-26 10:17 ` [PATCH v4 07/13] Input: adp5585: " Eliav Farber
2026-07-26 10:17 ` [PATCH v4 08/13] ACPI: APEI: GHES: remove unused ghes_{,un}register_vendor_record_notifier() Eliav Farber
2026-07-26 10:17 ` [PATCH v4 09/13] ACPI: APEI: GHES: use devm_blocking_notifier_chain_register() Eliav Farber
2026-07-26 10:17 ` [PATCH v4 10/13] platform/x86: uniwill-wmi: " Eliav Farber
2026-07-26 10:17 ` [PATCH v4 11/13] gpio: eic-sprd: use devm_atomic_notifier_chain_register() Eliav Farber
2026-07-26 10:28 ` sashiko-bot
2026-07-26 10:17 ` [PATCH v4 12/13] gpio: gpiolib-kunit: use devm_blocking_notifier_chain_register() Eliav Farber
2026-07-26 10:17 ` [PATCH v4 13/13] reboot: " Eliav Farber
2026-07-26 14:10 ` [PATCH v4 00/13] notifier: add device-managed registration APIs and convert drivers Borislav Petkov
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=20260726102717.E691A1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=farbere@amazon.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 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.