From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5255A2E7379; Sat, 30 May 2026 17:35:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780162551; cv=none; b=OYUIWfhILLXjvEpIZ6JwTnANpdZS1pcGiwsv3Xd5VjqEwMLlviSQ/TxpoOvZwcXgUr2dOPkSKAcs+AumrmoKXdBaeIERBJKnfr0GjkRKsEyO34u1N1ycL+VAVdRw9QnhzM29NC3zMQDVFknBxgvf5dGV3V4I+PMtiVZ/Yf2salk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780162551; c=relaxed/simple; bh=v3KKGhH5JqMLn6fKEPEkrtvW9sZ7gHjX3GYljnHIBQw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VoLnmQuXeUOQ5wCluUBc4dzwU2KezLbZk+CHqL1DzKKDZuKXs5tbGE5pyXMbL1leCzGn7mk74rgOrLv+BqhoOzOHoBGilHaWa/2RiztRZn9fItIuIDwRxpZxcfcwceoDPjF+oSW2v272hVUjqsollYinobGNOX/Yiuc0BV+GSz8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Od6xZhwp; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Od6xZhwp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94C991F00893; Sat, 30 May 2026 17:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780162550; bh=q/vda+3Y3Qvcn/dj2v+V4AmzB0v9znxW879U35bo/GI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Od6xZhwpI20xYO9T5Pty5x03063So0PapT3Um884w1P4Gp84oF+MN4bE5mSkWcgKS aGbqPXCWcF9MUsTzKbwn1YoR8QFJvDmvYN0oYGhn0Hc2IUAs8vF0W5iAT2qVxMoewG qfxx3jR6LdHsfjQ+tfv0jan3HWgq4OCI6NoqmAWM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Rafael J. Wysocki" , Andy Shevchenko , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Sasha Levin Subject: [PATCH 6.1 956/969] platform/x86: adv_swbutton: Check ACPI_HANDLE() against NULL Date: Sat, 30 May 2026 18:08:00 +0200 Message-ID: <20260530160327.168625743@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160300.485627683@linuxfoundation.org> References: <20260530160300.485627683@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rafael J. Wysocki [ Upstream commit e7a9a6ea40e352cd7977f6a8c80bdeadf65ad838 ] Every platform driver can be forced to match a device that doesn't match its list of device IDs because of device_match_driver_override(), so platform drivers that rely on the existence of a device's ACPI companion object need to verify its presence. Accordingly, add a requisite ACPI_HANDLE() check against NULL to the platform/x86 adv_swbutton driver. Fixes: 3d904005f686 ("platform/x86: add support for Advantech software defined button") Signed-off-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko Link: https://patch.msgid.link/5115425.31r3eYUQgx@rafael.j.wysocki Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen Signed-off-by: Sasha Levin --- drivers/platform/x86/adv_swbutton.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/adv_swbutton.c b/drivers/platform/x86/adv_swbutton.c index 38693b735c876..87b7fd09a6f6f 100644 --- a/drivers/platform/x86/adv_swbutton.c +++ b/drivers/platform/x86/adv_swbutton.c @@ -48,10 +48,14 @@ static int adv_swbutton_probe(struct platform_device *device) { struct adv_swbutton *button; struct input_dev *input; - acpi_handle handle = ACPI_HANDLE(&device->dev); + acpi_handle handle; acpi_status status; int error; + handle = ACPI_HANDLE(&device->dev); + if (!handle) + return -ENODEV; + button = devm_kzalloc(&device->dev, sizeof(*button), GFP_KERNEL); if (!button) return -ENOMEM; -- 2.53.0