From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF632C3DA7F for ; Thu, 1 Aug 2024 00:36:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7358510E7EF; Thu, 1 Aug 2024 00:36:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="IH82i5Ly"; dkim-atps=neutral Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5143B10E7EF; Thu, 1 Aug 2024 00:36:49 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 68F05CE1764; Thu, 1 Aug 2024 00:36:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1A5EC116B1; Thu, 1 Aug 2024 00:36:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722472606; bh=Co3rOYWFyMzUQ/iRBOHAF8/nPZFV/WYnqoQl2tPTpws=; h=From:To:Cc:Subject:Date:From; b=IH82i5LyYE8doxPOf26734EDraM0s0kJXkxZCtENe/HbCFQPkizAn9M44w/XNMJSy kKyjJQe+a6MLq/fIEawfaq8J2lsajYNBiVzhF3FuyJ+II7mwqCX6j+DgTm7MElazyf DO8ZY4bAEhjtt4kW9v+urWZGRaEY/3iw3rwiakB99vqZLpyXFZIioGE553MznVPsrl J8x38wAF4a96vRIn3yGPb8gBU9CLSzTcU5z6YQAMK4XfV+Jj+PwOdOxHkwQMwdGKt3 SNzOjyhwVe+xrFGOCr7yTAdmYWFZbWglMc2k0Od4+KYlnzpau1ejTlEstMGsjPeFYH Rg+d9kuUSt2Dg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tim Huang , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , Sasha Levin , Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, Jun.Ma2@amd.com, shashank.sharma@amd.com, hannes@cmpxchg.org, friedrich.vock@gmx.de, andrealmeid@igalia.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.10 01/38] drm/amdgpu: fix overflowed array index read warning Date: Wed, 31 Jul 2024 20:35:07 -0400 Message-ID: <20240801003643.3938534-1-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.10.223 Content-Transfer-Encoding: 8bit X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" From: Tim Huang [ Upstream commit ebbc2ada5c636a6a63d8316a3408753768f5aa9f ] Clear overflowed array index read warning by cast operation. Signed-off-by: Tim Huang Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index 15ee13c3bd9e1..6976f61be7341 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c @@ -368,8 +368,9 @@ static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf, size_t size, loff_t *pos) { struct amdgpu_ring *ring = file_inode(f)->i_private; - int r, i; uint32_t value, result, early[3]; + loff_t i; + int r; if (*pos & 3 || size & 3) return -EINVAL; -- 2.43.0