Re: [PATCH] platform/chrome: cros_usbpd_notify: Add NULL pointer check for ACPI companion
From: Tzung-Bi Shih
Date: Wed Apr 01 2026 - 22:32:43 EST
On Tue, Mar 31, 2026 at 09:10:44AM +0800, Wang Jun wrote:
> In cros_usbpd_notify_remove_acpi(), ACPI_COMPANION() may return NULL
> in certain scenarios. Directly dereferencing adev->handle without
> checking could lead to a kernel oops.
>
> Add a NULL check and emit a warning when no ACPI companion is found,
> then skip the notify handler removal to ensure safety.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 7e91e1ac60bb ("platform/chrome: cros_usbpd_notify: Amend ACPI driver to plat")
> Signed-off-by: Wang Jun <1742789905@xxxxxx>
The patch makes less sense to me. The device is matching and binding via
ACPI. The companion device should be there.