Skip to content

Commit 0314ceb

Browse files
harshimogalapallijwrdegoede
authored andcommitted
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: e709615 ("platform/x86/amd/pmf: Fixup error handling for amd_pmf_init_smart_pc()") Signed-off-by: Harshit Mogalapalli <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent aec7d25 commit 0314ceb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/platform/x86/amd/pmf/tee-if.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,10 @@ int amd_pmf_init_smart_pc(struct amd_pmf_dev *dev)
458458
amd_pmf_hex_dump_pb(dev);
459459

460460
dev->prev_data = kzalloc(sizeof(*dev->prev_data), GFP_KERNEL);
461-
if (!dev->prev_data)
461+
if (!dev->prev_data) {
462+
ret = -ENOMEM;
462463
goto error;
464+
}
463465

464466
ret = amd_pmf_start_policy_engine(dev);
465467
if (ret)

0 commit comments

Comments
 (0)