]> 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:07:20 +0000 (18:07 +0100)
commit78079fda4829020c76b1e607ea40423c54ac49ec
treef3abc14371e2b98e6d1ac518d618055b8df53f7c
parent9f82e8ace7d5f3f890d499f09fe2f3452fb85e35
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