From: "zhangpengjie (A)" <zhangpengjie2@huawei.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: <rafael@kernel.org>, <lenb@kernel.org>, <lihuisong@huawei.com>,
<linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<zhanjie9@hisilicon.com>, <zhenglifeng1@huawei.com>,
<yubowen8@huawei.com>, <linhongye@h-partners.com>,
<linuxarm@huawei.com>, <jonathan.cameron@huawei.com>,
<wangzhi12@huawei.com>
Subject: Re: [PATCH] ACPI: PCC: Fix race condition by removing static qualifier
Date: Thu, 11 Dec 2025 11:44:11 +0800 [thread overview]
Message-ID: <5e37b804-f91e-4f90-b0de-2d837257765b@huawei.com> (raw)
In-Reply-To: <20251210-valiant-watchful-guillemot-2bb5be@sudeepholla>
On 12/10/2025 10:54 PM, Sudeep Holla wrote:
> On Wed, Dec 10, 2025 at 09:26:34PM +0800, Pengjie Zhang 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.
>>
Hi, I'm lucky that I didn't run into any problems because of this, I
just found
this issue during code review.
> Ah, my mistake. I’m not sure how that slipped in other than a simple typo or
> copy/paste error. Thanks for catching it. Let me know if you spotted it
> because something broke or just from reading the code.
>
> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
>
>> Fixes: a10b1c99e2dc ("ACPI: PCC: Setup PCC Opregion handler only if platform interrupt is available")
>> Signed-off-by: Pengjie Zhang <zhangpengjie2@huawei.com>
>> ---
>> 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)
>> --
>> 2.33.0
>>
next prev parent reply other threads:[~2025-12-11 3:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-10 13:26 Pengjie Zhang
2025-12-10 14:54 ` Sudeep Holla
2025-12-11 1:35 ` lihuisong (C)
2025-12-11 3:44 ` zhangpengjie (A) [this message]
2025-12-15 12:02 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5e37b804-f91e-4f90-b0de-2d837257765b@huawei.com \
--to=zhangpengjie2@huawei.com \
--cc=jonathan.cameron@huawei.com \
--cc=lenb@kernel.org \
--cc=lihuisong@huawei.com \
--cc=linhongye@h-partners.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=rafael@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=wangzhi12@huawei.com \
--cc=yubowen8@huawei.com \
--cc=zhanjie9@hisilicon.com \
--cc=zhenglifeng1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®