[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0h2fmf=DFY2g9+sdStsj+coPQPwbub8QnNuaK26_xv69g@mail.gmail.com>
Date: Thu, 13 Oct 2022 13:42:48 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: pmanank200502@...il.com
Cc: rafael@...nel.org, lenb@...nel.org, linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ACPI: acpi_pcc.c: Fix unintentional integer overflow
On Thu, Oct 13, 2022 at 7:50 AM <pmanank200502@...il.com> wrote:
>
> From: Manank Patel <pmanank200502@...il.com>
>
> Fixed unintentional u32 overflow by casting it to u64 before multiplication.
>
> Signed-off-by: Manank Patel <pmanank200502@...il.com>
A Fixes tag would be nice to have here.
> ---
> 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 ee4ce5ba1fb2..b929d2e5c622 100644
> --- a/drivers/acpi/acpi_pcc.c
> +++ b/drivers/acpi/acpi_pcc.c
> @@ -112,7 +112,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
> * processor could be much slower to reply. So add an arbitrary
> * amount of wait on top of Nominal.
> */
> - usecs_lat = PCC_CMD_WAIT_RETRIES_NUM * data->pcc_chan->latency;
> + usecs_lat = PCC_CMD_WAIT_RETRIES_NUM * ((u64) data->pcc_chan->latency);
Or redefine PCC_CMD_WAIT_RETRIES_NUM as 500ULL?
> ret = wait_for_completion_timeout(&data->done,
> usecs_to_jiffies(usecs_lat));
> if (ret == 0) {
> --
> 2.38.0
>
Powered by blists - more mailing lists