Skip to content

Commit d713b8d

Browse files
Dan Carpenterjwrdegoede
authored andcommitted
platform/x86: amd-pmc: uninitialized variable in amd_pmc_s2d_init()
The "size" variable can be uninitialized if amd_pmc_send_cmd() fails. Fixes: 3d7d407 ("platform/x86: amd-pmc: Add support for AMD Spill to DRAM STB feature") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20220307141832.GA19660@kili Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent f2a6c7e commit d713b8d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/platform/x86/amd-pmc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,8 +708,9 @@ static const struct pci_device_id pmc_pci_ids[] = {
708708

709709
static int amd_pmc_s2d_init(struct amd_pmc_dev *dev)
710710
{
711-
u32 size, phys_addr_low, phys_addr_hi;
711+
u32 phys_addr_low, phys_addr_hi;
712712
u64 stb_phys_addr;
713+
u32 size = 0;
713714

714715
/* Spill to DRAM feature uses separate SMU message port */
715716
dev->msg_port = 1;

0 commit comments

Comments
 (0)