diff options
author | Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> | 2024-02-26 15:40:10 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2024-03-05 10:17:07 +0100 |
commit | 0314cebb29be2f961abb37bd0b01cb16899868f2 (patch) | |
tree | d0a82e717a86b3e95154215dcfba0ce83a534aa1 /drivers/platform/x86/amd | |
parent | platform/x86: p2sb: On Goldmont only cache P2SB and SPI devfn BAR (diff) | |
download | linux-0314cebb29be2f961abb37bd0b01cb16899868f2.tar.xz linux-0314cebb29be2f961abb37bd0b01cb16899868f2.zip |
platform/x86/amd/pmf: Fix missing error code in amd_pmf_init_smart_pc()
On the error path, assign -ENOMEM to ret when memory allocation of
"dev->prev_data" fails.
Fixes: e70961505808 ("platform/x86/amd/pmf: Fixup error handling for amd_pmf_init_smart_pc()")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20240226144011.2100804-1-harshit.m.mogalapalli@oracle.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/amd')
-rw-r--r-- | drivers/platform/x86/amd/pmf/tee-if.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/x86/amd/pmf/tee-if.c b/drivers/platform/x86/amd/pmf/tee-if.c index 8527dca9cf56..dcbe8f85e122 100644 --- a/drivers/platform/x86/amd/pmf/tee-if.c +++ b/drivers/platform/x86/amd/pmf/tee-if.c @@ -458,8 +458,10 @@ int amd_pmf_init_smart_pc(struct amd_pmf_dev *dev) amd_pmf_hex_dump_pb(dev); dev->prev_data = kzalloc(sizeof(*dev->prev_data), GFP_KERNEL); - if (!dev->prev_data) + if (!dev->prev_data) { + ret = -ENOMEM; goto error; + } ret = amd_pmf_start_policy_engine(dev); if (ret) |