From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E7F6224220; Mon, 2 Jun 2025 14:48:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748875690; cv=none; b=a0/yiBOJZtIdVG+Lr/QgJux8tTMEfaXLjpajEaxl86pTsEKt/3yNrv9pCIQive7a+XXL2SOyCTNd4rvI9j2+tH7ugIWnFj6SBubpf56G/2YLNjuHf5y1PCwnSVDx4pbFWx/ZXPdN9LX2WuNp+ijYHaDsY5W3YqhD16pfIWgoElM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748875690; c=relaxed/simple; bh=TVbqqEw9dRFJPMABtp7AeHdWshiAqExJySu7wfodMnc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T6lOpHZU3DmvId/OyshcIJg9Dabbrv4yB+2kLXJSmOAtKD9/tA23HsgCz9XZZbBVMKa9TykMEAQqTJY6uTIJXm+vu2gk5ouiqSiwzlaGPJ+WDHmhgVMNbv87mDaaguBOngaXy/AvxWJv7J8cbDlNE6I/oaCHA8rct/dm3EvaOWw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qA1NpzNg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qA1NpzNg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90DD2C4CEEB; Mon, 2 Jun 2025 14:48:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748875690; bh=TVbqqEw9dRFJPMABtp7AeHdWshiAqExJySu7wfodMnc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qA1NpzNg/P0jp8m/r+jODCX4HB67Vl8PBp4an8F4kbB0QAL7c1W9bKu9rjYW0wEIX NX/ALHZitW0n2M2R/PxpPkrgUKiLWCcqjQ9438LHJEC0dXvcCRLNfLydcQyrgspwY7 Q36EZlj9HLJotYpNL0rrEihFGb0Ks+2H7JeJDWMw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Andrey Vatoropin , Guenter Roeck , Sasha Levin Subject: [PATCH 5.10 213/270] hwmon: (xgene-hwmon) use appropriate type for the latency value Date: Mon, 2 Jun 2025 15:48:18 +0200 Message-ID: <20250602134315.889505168@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134307.195171844@linuxfoundation.org> References: <20250602134307.195171844@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andrey Vatoropin [ Upstream commit 8df0f002827e18632dcd986f7546c1abf1953a6f ] The expression PCC_NUM_RETRIES * pcc_chan->latency is currently being evaluated using 32-bit arithmetic. Since a value of type 'u64' is used to store the eventual result, and this result is later sent to the function usecs_to_jiffies with input parameter unsigned int, the current data type is too wide to store the value of ctx->usecs_lat. Change the data type of "usecs_lat" to a more suitable (narrower) type. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Andrey Vatoropin Link: https://lore.kernel.org/r/20250204095400.95013-1-a.vatoropin@crpt.ru Signed-off-by: Guenter Roeck Signed-off-by: Sasha Levin --- drivers/hwmon/xgene-hwmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c index 559a73bab51e8..15889bcc85875 100644 --- a/drivers/hwmon/xgene-hwmon.c +++ b/drivers/hwmon/xgene-hwmon.c @@ -110,7 +110,7 @@ struct xgene_hwmon_dev { phys_addr_t comm_base_addr; void *pcc_comm_addr; - u64 usecs_lat; + unsigned int usecs_lat; }; /* -- 2.39.5