Skip to content

Commit f103fa1

Browse files
Pengjie Zhangrafaeljw
authored andcommitted
ACPI: PCC: Fix race condition by removing static qualifier
Local variable 'ret' in acpi_pcc_address_space_setup() is currently declared as 'static'. This can lead to race conditions in a multithreaded environment. Remove the 'static' qualifier to ensure that 'ret' will be allocated directly on the stack as a local variable. Fixes: a10b1c9 ("ACPI: PCC: Setup PCC Opregion handler only if platform interrupt is available") Signed-off-by: Pengjie Zhang <zhangpengjie2@huawei.com> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> Acked-by: lihuisong@huawei.com Cc: 6.2+ <stable@vger.kernel.org> # 6.2+ [ rjw: Changelog edits ] Link: https://patch.msgid.link/20251210132634.2050033-1-zhangpengjie2@huawei.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 6ea3a44 commit f103fa1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/acpi/acpi_pcc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
5252
struct pcc_data *data;
5353
struct acpi_pcc_info *ctx = handler_context;
5454
struct pcc_mbox_chan *pcc_chan;
55-
static acpi_status ret;
55+
acpi_status ret;
5656

5757
data = kzalloc(sizeof(*data), GFP_KERNEL);
5858
if (!data)

0 commit comments

Comments
 (0)