Re: [PATCH] ACPI: PCC: Fix race condition by removing static qualifier

From: Rafael J. Wysocki

Date: Mon Dec 15 2025 - 07:02:44 EST


On Wed, Dec 10, 2025 at 2:26 PM Pengjie Zhang <zhangpengjie2@xxxxxxxxxx> wrote:
>
> The variable 'ret' in acpi_pcc_address_space_setup() is currently
> declared with the 'static' storage specifier. This can lead to race
> conditions in a multithreaded environment.
>
> Remove the 'static' qualifier to ensure 'ret' is allocated directly
> on the stack as a local variable.
>
> Fixes: a10b1c99e2dc ("ACPI: PCC: Setup PCC Opregion handler only if platform interrupt is available")
> Signed-off-by: Pengjie Zhang <zhangpengjie2@xxxxxxxxxx>
> ---
> drivers/acpi/acpi_pcc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c
> index 97064e943768..e3f302b9dee5 100644
> --- a/drivers/acpi/acpi_pcc.c
> +++ b/drivers/acpi/acpi_pcc.c
> @@ -52,7 +52,7 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
> struct pcc_data *data;
> struct acpi_pcc_info *ctx = handler_context;
> struct pcc_mbox_chan *pcc_chan;
> - static acpi_status ret;
> + acpi_status ret;
>
> data = kzalloc(sizeof(*data), GFP_KERNEL);
> if (!data)
> --

Applied as 6.19-rc material, thanks!