]> Gentwo Git Trees - linux/.git/commitdiff
RAS/AMD/ATL: Return error codes from helper functions
authorYazen Ghannam <yazen.ghannam@amd.com>
Mon, 6 Oct 2025 15:10:27 +0000 (15:10 +0000)
committerBorislav Petkov (AMD) <bp@alien8.de>
Fri, 17 Oct 2025 12:38:42 +0000 (14:38 +0200)
Pass up error codes from helper functions rather than discarding them.

Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
drivers/ras/amd/atl/core.c
drivers/ras/amd/atl/system.c

index 4197e10993acaaa0a5097c7f21796ccde418020c..0f7cd6dab0b0e08fd901c04aa7ee71ae4fb229d0 100644 (file)
@@ -194,6 +194,8 @@ MODULE_DEVICE_TABLE(x86cpu, amd_atl_cpuids);
 
 static int __init amd_atl_init(void)
 {
+       int ret;
+
        if (!x86_match_cpu(amd_atl_cpuids))
                return -ENODEV;
 
@@ -202,8 +204,9 @@ static int __init amd_atl_init(void)
 
        check_for_legacy_df_access();
 
-       if (get_df_system_info())
-               return -ENODEV;
+       ret = get_df_system_info();
+       if (ret)
+               return ret;
 
        /* Increment this module's recount so that it can't be easily unloaded. */
        __module_get(THIS_MODULE);
index e18d916d5e8b9af4ef00de4c65001d621d91428c..099841433cf929299d484d1f0e95425459b480d5 100644 (file)
@@ -288,10 +288,13 @@ static void dump_df_cfg(void)
 
 int get_df_system_info(void)
 {
-       if (determine_df_rev()) {
+       int ret;
+
+       ret = determine_df_rev();
+       if (ret) {
                pr_warn("Failed to determine DF Revision");
                df_cfg.rev = UNKNOWN;
-               return -EINVAL;
+               return ret;
        }
 
        apply_node_id_shift();