From: Dan Carpenter <dan.carpenter@oracle.com>
To: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
Sanket Goswami <Sanket.Goswami@amd.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
Mark Gross <markgross@kernel.org>,
Mario Limonciello <mario.limonciello@amd.com>,
platform-driver-x86@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] platform/x86: amd-pmc: uninitialized variable in amd_pmc_s2d_init()
Date: Mon, 7 Mar 2022 17:18:32 +0300 [thread overview]
Message-ID: <20220307141832.GA19660@kili> (raw)
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
next reply other threads:[~2022-03-07 14:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 14:18 Dan Carpenter [this message]
2022-03-08 15:24 ` [PATCH] platform/x86: amd-pmc: uninitialized variable in amd_pmc_s2d_init() Hans de Goede
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=20220307141832.GA19660@kili \
--to=dan.carpenter@oracle.com \
--cc=Sanket.Goswami@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=hdegoede@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@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