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 9C230C47DA9 for ; Sun, 28 Jan 2024 16:14:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B4D41126EF; Sun, 28 Jan 2024 16:14:05 +0000 (UTC) Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 55A9F1126EF; Sun, 28 Jan 2024 16:14:04 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 99DCECE0C6B; Sun, 28 Jan 2024 16:14:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86D5AC43390; Sun, 28 Jan 2024 16:14:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706458441; bh=//GeY34yk8RDTyVL3z8PggsoJVR+7RJuYVHF4BbXmUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vJN88zEWZKNIstzagEKQvSaL7gH1/NWwAUkOq9qHhn5D3N9SmSZm84pmHtXXdL5rR fj+EdsXJx5FOUwRMVpRbILQdgs4SGL9r0f5DmIPPB1YwzHwapaottnxS9VuNpMpZlq kfwauByCDpZpcplMM7slu/xjWFeFhrVF3SzQsXjFQFXGJiriC8OS/2irGjVlfN6Enj eBpAOmvmB9+bqc+kb9zbnrTvkMdXcuKMR8LZ9WVIu6q09jKabtogE+okwVncf8YTyX hrJlrVEcbcEzefjUwH3i6W7zTDt2QvPVuBU0vEn7g4VwpE77rxqIkd6U9r7TfR40T+ imvaA9tkuJQYg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 27/31] drm/amd/powerplay: Fix kzalloc parameter 'ATOM_Tonga_PPM_Table' in 'get_platform_power_management_table()' Date: Sun, 28 Jan 2024 11:12:57 -0500 Message-ID: <20240128161315.201999-27-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240128161315.201999-1-sashal@kernel.org> References: <20240128161315.201999-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.14 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: , Cc: Sasha Levin , Srinivasan Shanmugam , Xinhui.Pan@amd.com, amd-gfx@lists.freedesktop.org, Alex Deucher , dri-devel@lists.freedesktop.org, daniel@ffwll.ch, Eric Huang , evan.quan@amd.com, airlied@gmail.com, =?UTF-8?q?Christian=20K=C3=B6nig?= Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" From: Srinivasan Shanmugam [ Upstream commit 6616b5e1999146b1304abe78232af810080c67e3 ] In 'struct phm_ppm_table *ptr' allocation using kzalloc, an incorrect structure type is passed to sizeof() in kzalloc, larger structure types were used, thus using correct type 'struct phm_ppm_table' fixes the below: drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/process_pptables_v1_0.c:203 get_platform_power_management_table() warn: struct type mismatch 'phm_ppm_table vs _ATOM_Tonga_PPM_Table' Cc: Eric Huang Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Acked-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c index f2a55c1413f5..17882f8dfdd3 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c @@ -200,7 +200,7 @@ static int get_platform_power_management_table( struct pp_hwmgr *hwmgr, ATOM_Tonga_PPM_Table *atom_ppm_table) { - struct phm_ppm_table *ptr = kzalloc(sizeof(ATOM_Tonga_PPM_Table), GFP_KERNEL); + struct phm_ppm_table *ptr = kzalloc(sizeof(*ptr), GFP_KERNEL); struct phm_ppt_v1_information *pp_table_information = (struct phm_ppt_v1_information *)(hwmgr->pptable); -- 2.43.0