linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: pmanank200502@gmail.com
To: rafael@kernel.org
Cc: lenb@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Manank Patel <pmanank200502@gmail.com>
Subject: [PATCH] ACPI: acpi_pcc.c: Fix unintentional integer overflow
Date: Thu, 13 Oct 2022 11:19:48 +0530	[thread overview]
Message-ID: <20221013054947.1355884-1-pmanank200502@gmail.com> (raw)

From: Manank Patel <pmanank200502@gmail.com>

Fixed unintentional u32 overflow by casting it to u64 before multiplication.

Signed-off-by: Manank Patel <pmanank200502@gmail.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 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);
 		ret = wait_for_completion_timeout(&data->done,
 						  usecs_to_jiffies(usecs_lat));
 		if (ret == 0) {
-- 
2.38.0


             reply	other threads:[~2022-10-13  5:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13  5:49 pmanank200502 [this message]
2022-10-13 11:42 ` [PATCH] ACPI: acpi_pcc.c: Fix unintentional integer overflow Rafael J. Wysocki
2022-10-13 13:03   ` [PATCH] Fixes: 91cefefb6991 ("ACPI: acpi_pcc.c: fixed unintentional u32 overflow by redefining a constant") Manank Patel
2022-10-17 17:49     ` [PATCH] Fixes: 91cefefb6991 ("ACPI: PCC: replace wait_for_completion()") Manank Patel
2022-10-17 18:20       ` Sudeep Holla
2022-10-17 18:43         ` [PATCH v2] "ACPI: PCC: Fix unintentional integer overflow" Manank Patel
2022-10-18  1:12           ` lihuisong (C)
2022-10-26 11:34             ` 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=20221013054947.1355884-1-pmanank200502@gmail.com \
    --to=pmanank200502@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).