Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp780699rdb; Sun, 28 Jan 2024 08:37:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoaETP1oa9oDyL6ZuI2Oe+PVCnburk5cd3tyV37igtjIDOYms0kyDk2Spg10PHbvPIfvmP X-Received: by 2002:a17:90b:120c:b0:292:8848:f6e9 with SMTP id gl12-20020a17090b120c00b002928848f6e9mr1081016pjb.32.1706459878943; Sun, 28 Jan 2024 08:37:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706459878; cv=pass; d=google.com; s=arc-20160816; b=PWFU2IipHTKpXR78R9ngeUGxR1DVZqM/bBWkkOKzqli+HKZlm5OnjskAUOBkls3EkO z1hLiphg+y6TqAfBMd3tFO3OuZ8j7VmLLXED9pjJ3TvU7TXD0AQYxflr+vGMfJ49IMjJ pzq4w2JigWs2ReOiJhtBWB4wsUwF2qEdg4f2E/w9Zh/CdSmxuRUFok9A85TfZ9Fs2tZ+ hnMjJHzTTT3TuQYQVeKuYrFiILCin6W9P/tShk7v6zdHqrIvZfRht9y+1jJvp1BHXFDV 4s8gMcXdbWAXjWXntcqfBO/mjkzZPOrNfax5V2EVPZZCwepZJdxYQg592U9fLIz8YZZV LBTQ== 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=d0jaNQGq+ouoMOVTJhrjGP/e6zQypYfPyP/o9uJeSbJ2SbySBaZIBBI0nfQZ+HmCsF hoygQg6exos7jKETaKUEOczV+n3jMVR4tOFfzlm34SwlnsXer9wM9lTVXR3imSNtSoVC ghhnamlH7vcKmb6M63fpoMyqQoEyIRNKeB1l++cIsbt4LCZXOc6MPiEm3O+6dM9SXn0D 6+w1C4GghvYgtB4V0dD/RrbdI+GJIOpv2JgjNlz1tARGBInSOlW2hS1LGkV5n2W3zKGV rHo/kLRQhC2ndcIJdN3Rjvc8F+roT7p9wi59saFClaJKveScFVDYcqTG0BH9XJRhFrD0 nh+g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kjQgxB6O; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-41778-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41778-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j1-20020a17090ac48100b00290f2463cf6si4299422pjt.190.2024.01.28.08.37.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 08:37:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41778-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kjQgxB6O; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-41778-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41778-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4B470281D78 for ; Sun, 28 Jan 2024 16:37:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBB7C12838B; Sun, 28 Jan 2024 16:15:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kjQgxB6O" 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 0A9CF12837D; Sun, 28 Jan 2024 16:15:05 +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=1706458505; cv=none; b=RuVG7e4XN0o3mw4JYmOMWgc+Cg+i2IN1feU3Aee73ks5W+aeC+50hdidCb2mteu9SS/dbWAD3csZSlPJxxEifQqOp7BDeTaxkzOxLGT02qzLYgygQoWszEGY02bTylnNp0OTRTkn4+EImHyXAtPhlb3A+XJabWoXgCXku0lriW0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706458505; c=relaxed/simple; bh=//GeY34yk8RDTyVL3z8PggsoJVR+7RJuYVHF4BbXmUk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Hb7qzhHb1r3VFn+Ywt/D6iTNzc8h0CwB9wsopw36RQ19DGTJYyTEHyP2CZIadphf1diGYlm4xxRB+7HVegtLfv06zulFz6KBVi3L9babMonZJDrOubyo+pmoxtrS00Fy2w+XggHzv1fcZ+yVxbfqQPnDpErrphT4+zyBpa/soTk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kjQgxB6O; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79103C433C7; Sun, 28 Jan 2024 16:15:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706458504; bh=//GeY34yk8RDTyVL3z8PggsoJVR+7RJuYVHF4BbXmUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kjQgxB6OX9oy97kOW6rGLiQUxYODndhe0zflqX60mT25YFddoTOk5PJUsdfUvtjPE BSkCX9/ythA8/CzcYPOCPs40v4vCZBNR1INQ2CPPBdhyhCVhNfiC02GrsmmP+vD9Wk tjlcsIBb/oUcYF+XLI4ZxrENMc3oMsCMV4yqa4n6enO/4BMnSf8zs2YAdmZ6t0+zv5 GKiPYCJbjXES7s7ez/DSJ0p6+3xHMSp1j2iDY+hvTFNwcUokmBNtD7+xRTQQeZEv/o GqNMzi3lFmTd5gZpQwDs8U1yOkuns4F0WBgnhsl85uuGYGBjZ8gOPcqdRuTNO7E88b TzmnXscr0dt5A== 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.1 23/27] drm/amd/powerplay: Fix kzalloc parameter 'ATOM_Tonga_PPM_Table' in 'get_platform_power_management_table()' Date: Sun, 28 Jan 2024 11:14:08 -0500 Message-ID: <20240128161424.203600-23-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240128161424.203600-1-sashal@kernel.org> References: <20240128161424.203600-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.1.75 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