]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ACPI: resource: Fix memory resource type union access
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 2 Dec 2024 10:06:13 +0000 (12:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Dec 2024 17:08:55 +0000 (18:08 +0100)
commit73d97072f6567784c50a765dd9b1adf88a288b34
treefdf6e6ade3c2d62b736a01ea05f81b21380ee191
parent32e2b0b796a5f13d48177b78fb860b8acde54348
ACPI: resource: Fix memory resource type union access

[ Upstream commit 7899ca9f3bd2b008e9a7c41f2a9f1986052d7e96 ]

In acpi_decode_space() addr->info.mem.caching is checked on main level
for any resource type but addr->info.mem is part of union and thus
valid only if the resource type is memory range.

Move the check inside the preceeding switch/case to only execute it
when the union is of correct type.

Fixes: fcb29bbcd540 ("ACPI: Add prefetch decoding to the address space parser")
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://patch.msgid.link/20241202100614.20731-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/resource.c