Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp779228rdb; Sun, 28 Jan 2024 08:33:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHwjA6NVM7dh0Gxwn+ZX1lBNICFi+bqDg88kMwEaJbkdc2zGmv7hNn/U7pTz18Hn3ArbvID X-Received: by 2002:a17:906:490c:b0:a30:f4a2:5688 with SMTP id b12-20020a170906490c00b00a30f4a25688mr3085159ejq.1.1706459609499; Sun, 28 Jan 2024 08:33:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706459609; cv=pass; d=google.com; s=arc-20160816; b=PicK+ttd5N9hPPGtcRxTx5zvzLfUme0x8AOZNsxFEfnFW9ygy2DL2bmzJg0JdARLDE pwBD50lqfJJQ+gY52fN8s+rQNtN0o4umNSuflF0+1YjIqwxIzkHlGagi6z8fVYogbXBQ UHM3RNcHWbTtPgzq/8Cyg6/b7xRGLj6ZEtyhzthKT48A3A7K59wgI3/YDhPt8u1AgFg3 HjdqHFuHIcJBKwyF/RecBhfDL92iqI3gGuybpBQWQYuie/PzlM8ichlTqjQ21K/Dwz3H X1wRYHlFSlHLF6yTFsaiZmBmrXof3F3S24LOl412Di+IDdSmnSpg5wYMKkJM/mtuFdex f7zA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=6v2PMGmH/2P1LW6wTTn6hog/lNHMrnvJsp0YWAmQEGc=; fh=V7jCqD4uylTjNXV9DJ0JCzJ6VJkcspnweciWmcfBTsA=; b=vWoZjTmPxw0IJnCotK7R0x05TkNSvyiImt+87sMrocm51ff1Caa0wv14e3wfQw6dCn K6T0GnDVpWbPjN700HNdUN0eLaigE53O3J0QbjZlnCOH+AuOJoKixUtroPqTfoOFMbOW CqAPWBUfiRBWxs0jP2JzN13kUVDkmu4pOahoT7M0uLvor0bjoURlYpLflGt0ycb+ldKT DATS536C/fGZHl8T6L0Bq9YMVKk192tcxHp7ziEgpcXP402EhxILguiAKtLwxkbNgo7n DiMeaXz8F0Ijc77DimIR/uzS9rW3wi5vAw60p3M0GVZglaRMH16AcG0z44GrD/E2ETX3 9kcg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Pwk7u6Nj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-41717-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41717-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id rn10-20020a170906d92a00b00a2f7ba22fdbsi2725085ejb.776.2024.01.28.08.33.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 08:33:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41717-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Pwk7u6Nj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-41717-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41717-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CC8121F28524 for ; Sun, 28 Jan 2024 16:21:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2C1357898; Sun, 28 Jan 2024 16:12:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Pwk7u6Nj" 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 C68F158104; Sun, 28 Jan 2024 16:12:49 +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=1706458369; cv=none; b=jk7q6jVxvcwA+NAw06I+3QMbczdTXv0KiJlwUoZd0muNUFjL5TCn7Urhz/19W5Nz0B/OGk+7Cu3SXIZQcGyYo1TY+ClJvCzdwRPp61AnCoNy95HPq7nM5k6h6FCnCEyWVWGBRITN34zRfdq6iAr34iNe9+sEJmGD7QnyCIHE8a0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706458369; c=relaxed/simple; bh=//GeY34yk8RDTyVL3z8PggsoJVR+7RJuYVHF4BbXmUk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JQkCVRrDxxJk6A+m1BzF0f0sxhzXevomWqykb5w1R7j2L8oURifYIjP+//M7pol4N/rAHlzqGaDwEz+aBmxLZhmlH6TiNctil0EZfHHbgIvq5RraxL3WE8BOWXZ1atUzuhRi5pI+puOgM9fSkGcBFvDZfohW1TkpPTmDZbJoJ+Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Pwk7u6Nj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5080BC43390; Sun, 28 Jan 2024 16:12:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706458369; bh=//GeY34yk8RDTyVL3z8PggsoJVR+7RJuYVHF4BbXmUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pwk7u6NjuKEedMEm1srkw6Bg5Wl4nwtAoV8W9PM3LJ6w8GOVuhgyWR6HZl5xoSLht u1UNdrTVxSO5IXLwwWFYsm53egOArbbtYpBHtTjWiJnFVHPFrZJcYqu4GTJXSEUEId tgGejC9cFd2Kq9NHgTXfVJVjV0e8cdunZwz5gMkTSupS0qjaLzMS5hkG3Tx4bW/PqU 68BLGa+Ua7sg6QGGZcoDvwtP7zm1K9o9RLZHJl4JxVd6/dfhLQPCjqWT7TaEu69fQK 9M8+/pXO4Fu2V0Ln5ajQcWt6zzN+FVslsbruQCOorLTLTENhbW9QuXWoc0eUdJ7LcR kWV1J3ZS7jJtw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Srinivasan Shanmugam , Eric Huang , =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher , Sasha Levin , evan.quan@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.7 35/39] drm/amd/powerplay: Fix kzalloc parameter 'ATOM_Tonga_PPM_Table' in 'get_platform_power_management_table()' Date: Sun, 28 Jan 2024 11:10:55 -0500 Message-ID: <20240128161130.200783-35-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240128161130.200783-1-sashal@kernel.org> References: <20240128161130.200783-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.2 Content-Transfer-Encoding: 8bit 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