From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Srinivasan Shanmugam" <srinivasan.shanmugam@amd.com>,
"Eric Huang" <JinHuiEric.Huang@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Sasha Levin" <sashal@kernel.org>,
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 5.15 17/19] drm/amd/powerplay: Fix kzalloc parameter 'ATOM_Tonga_PPM_Table' in 'get_platform_power_management_table()'
Date: Sun, 28 Jan 2024 11:15:14 -0500 [thread overview]
Message-ID: <20240128161524.204182-17-sashal@kernel.org> (raw)
In-Reply-To: <20240128161524.204182-1-sashal@kernel.org>
From: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
[ 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 <JinHuiEric.Huang@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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
next prev parent reply other threads:[~2024-01-28 16:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-28 16:14 [PATCH AUTOSEL 5.15 01/19] PCI: Only override AMD USB controller if required Sasha Levin
2024-01-28 16:14 ` [PATCH AUTOSEL 5.15 02/19] PCI: switchtec: Fix stdev_release() crash after surprise hot remove Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 03/19] perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 04/19] xhci: fix possible null pointer deref during xhci urb enqueue Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 05/19] usb: hub: Replace hardcoded quirk value with BIT() macro Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 06/19] selftests/sgx: Fix linker script asserts Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 07/19] tty: allow TIOCSLCKTRMIOS with CAP_CHECKPOINT_RESTORE Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 08/19] fs/kernfs/dir: obey S_ISGID Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 09/19] PCI: Fix 64GT/s effective data rate calculation Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 10/19] PCI/AER: Decode Requester ID when no error info found Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 11/19] misc: lis3lv02d_i2c: Add missing setting of the reg_ctrl callback Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 12/19] libsubcmd: Fix memory leak in uniq() Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 13/19] drm/amdkfd: Fix lock dependency warning Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 14/19] virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 15/19] blk-mq: fix IO hang from sbitmap wakeup race Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 16/19] ceph: fix deadlock or deadcode of misusing dget() Sasha Levin
2024-01-28 16:15 ` Sasha Levin [this message]
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 18/19] drm/amdgpu: Release 'adev->pm.fw' before return in 'amdgpu_device_need_post()' Sasha Levin
2024-01-28 16:15 ` [PATCH AUTOSEL 5.15 19/19] drm/amdkfd: Fix 'node' NULL check in 'svm_range_get_range_boundaries()' Sasha Levin
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=20240128161524.204182-17-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=JinHuiEric.Huang@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=evan.quan@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=srinivasan.shanmugam@amd.com \
--cc=stable@vger.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