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 4ECA6233D9E; Sat, 30 May 2026 18:19:09 +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=1780165150; cv=none; b=jEO4f6onZm+BOy6o6uvNhzb/w5EwPH/V6Ge8w9vB2rT/r6QqK6HTTK+kYRA9O9DqYPMMVJd8PMXRO1gQnxbeOweZbKGusofw0o6QcLROZEuEMCqRSkQxvLO2J0BOSKaDU6f5825xKTT6HGywzZrvq9OghjEcA/t4myTwb/MAS8g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780165150; c=relaxed/simple; bh=v++4lNgGrOViRJxJXe6gbVqlzosUZ/FOOp6lHxDB2A8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hHpLTSv92SRhz57Huim23GUeK5SoNEJ/8sd4IPs3MGrkgQ7rn4KFKWfO6ww1yhuPg+VjMGrCkTcV/wh85veakMVSDhos9DIe9V3N5LjPbWcoAO0aWkM2h010oTr3SZA/gGaBq13bzX5heUFBpNwM2fmhA5B7eacYuqq//Debm24= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=h1xAqe3F; 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="h1xAqe3F" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5ADA91F00893; Sat, 30 May 2026 18:19:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780165149; bh=qYLb7sb12TUlpBH4vD2keCaQ8w2zWoHO6q9BlF1gQ0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=h1xAqe3FLPhW0C1GCR+vTSbDas/vFoU+BT2BuT3dw9kgiKPhN65M/mwJZnbySHPxh UFtHrOS4Yi1QQyorOcPtHc/BDQm1Jh26+Jo8FjMSjYlnBKitC2GzFfJVIqV2p8b9VR Oa2ev/KILQgb6rqd1XR6tj1SM4SMnY7bjUt7eVmw= 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 5.15 764/776] platform/x86: adv_swbutton: Check ACPI_HANDLE() against NULL Date: Sat, 30 May 2026 18:07:58 +0200 Message-ID: <20260530160259.475269422@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160240.228940103@linuxfoundation.org> References: <20260530160240.228940103@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 5.15-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