]> Git Repo - J-linux.git/commitdiff
platform/x86/amd/pmf: Fix missing error code in amd_pmf_init_smart_pc()
authorHarshit Mogalapalli <[email protected]>
Mon, 26 Feb 2024 14:40:10 +0000 (06:40 -0800)
committerHans de Goede <[email protected]>
Tue, 5 Mar 2024 09:17:07 +0000 (10:17 +0100)
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 <[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]>
drivers/platform/x86/amd/pmf/tee-if.c

index 8527dca9cf5604dc140ac22c5f06870bd32be296..dcbe8f85e122947be014778c14478a7374698b49 100644 (file)
@@ -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)
This page took 0.047016 seconds and 4 git commands to generate.