Re: [PATCH v3 2/3] platform/x86: topstar-laptop: Check ACPI_COMPANION() against NULL
From: Ilpo Järvinen
Date: Mon Oct 19 2026 - 02:10:26 EST
On Sat, 17 Oct 2026, Jiale Yao wrote:
> Add a requisite ACPI_COMPANION() check against NULL to the
> topstar-laptop driver, aligning with the fix applied to
> asus-wireless driver.
>
> Assisted-by: claude:deepseek-v4-pro
> Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
> ---
> drivers/platform/x86/topstar-laptop.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/platform/x86/topstar-laptop.c b/drivers/platform/x86/topstar-laptop.c
> index e09d7f8ce45f..f6fafa345f93 100644
> --- a/drivers/platform/x86/topstar-laptop.c
> +++ b/drivers/platform/x86/topstar-laptop.c
> @@ -291,6 +291,9 @@ static int topstar_acpi_probe(struct platform_device *pdev)
> struct topstar_laptop *topstar;
> int err;
>
> + if (!device)
Call and it's error handling should kept together.
> + return -ENODEV;
> +
> dmi_check_system(topstar_dmi_ids);
>
> topstar = kzalloc_obj(struct topstar_laptop);
>
--
i.