X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH] platform/x86: amd-pmc: uninitialized variable in amd_pmc_s2d_init()
@ 2022-03-07 14:18 Dan Carpenter
  2022-03-08 15:24 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2022-03-07 14:18 UTC (permalink / raw)
  To: Shyam Sundar S K, Sanket Goswami
  Cc: Hans de Goede, Mark Gross, Mario Limonciello, platform-driver-x86,
	kernel-janitors

The "size" variable can be uninitialized if amd_pmc_send_cmd() fails.

Fixes: 3d7d407dfb05 ("platform/x86: amd-pmc: Add support for AMD Spill to DRAM STB feature")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/platform/x86/amd-pmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c
index 425a86108f75..fc0b4d628dec 100644
--- a/drivers/platform/x86/amd-pmc.c
+++ b/drivers/platform/x86/amd-pmc.c
@@ -708,8 +708,9 @@ static const struct pci_device_id pmc_pci_ids[] = {
 
 static int amd_pmc_s2d_init(struct amd_pmc_dev *dev)
 {
-	u32 size, phys_addr_low, phys_addr_hi;
+	u32 phys_addr_low, phys_addr_hi;
 	u64 stb_phys_addr;
+	u32 size = 0;
 
 	/* Spill to DRAM feature uses separate SMU message port */
 	dev->msg_port = 1;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-08 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-07 14:18 [PATCH] platform/x86: amd-pmc: uninitialized variable in amd_pmc_s2d_init() Dan Carpenter
2022-03-08 15:24 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox