From: Jiale Yao <yaojiale02@163.com>
To: "Łukasz Bartosik" <ukaszb@chromium.org>,
"Andrei Kuchynski" <akuchynski@chromium.org>,
"Jameson Thies" <jthies@google.com>,
"Benson Leung" <bleung@chromium.org>,
"Tzung-Bi Shih" <tzungbi@kernel.org>,
"Enric Balletbo i Serra" <eballetbo@kernel.org>,
"Prashant Malani" <pmalani@chromium.org>,
chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: [PATCH 2/2] platform/chrome: cros_usbpd_notify: check ACPI companion
Date: Wed, 28 Oct 2026 13:10:59 +0800 [thread overview]
Message-ID: <20261028051059.143646-1-yaojiale02@163.com> (raw)
The ACPI probe installs a notification handler through the device ACPI
companion without checking that the companion exists. A force-bound
platform device can therefore cause a NULL pointer dereference.
Return -ENODEV before allocating probe resources when the companion is
missing.
Fixes: 7e91e1ac60bb ("platform/chrome: cros_usbpd_notify: Amend ACPI driver to plat")
Cc: stable@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
drivers/platform/chrome/cros_usbpd_notify.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/platform/chrome/cros_usbpd_notify.c b/drivers/platform/chrome/cros_usbpd_notify.c
index 25da31ec1996..1d82c74583cb 100644
--- a/drivers/platform/chrome/cros_usbpd_notify.c
+++ b/drivers/platform/chrome/cros_usbpd_notify.c
@@ -105,6 +105,8 @@ static int cros_usbpd_notify_probe_acpi(struct platform_device *pdev)
acpi_status status;
adev = ACPI_COMPANION(dev);
+ if (!adev)
+ return -ENODEV;
pdnotify = devm_kzalloc(dev, sizeof(*pdnotify), GFP_KERNEL);
if (!pdnotify)
--
2.34.1
next reply other threads:[~2026-10-28 5:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 5:10 Jiale Yao [this message]
2026-10-28 5:11 [PATCH 0/2] platform/chrome: check ACPI companions before use Jiale Yao
2026-10-28 5:12 ` [PATCH 2/2] platform/chrome: cros_usbpd_notify: check ACPI companion Jiale Yao
2026-10-29 3:19 ` Tzung-Bi Shih
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=20261028051059.143646-1-yaojiale02@163.com \
--to=yaojiale02@163.com \
--cc=akuchynski@chromium.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=eballetbo@kernel.org \
--cc=jthies@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pmalani@chromium.org \
--cc=stable@vger.kernel.org \
--cc=tzungbi@kernel.org \
--cc=ukaszb@chromium.org \
/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
all inboxes | Powered by JetHome®