Skip to content

Commit 6553c68

Browse files
yghannambp3tk0v
authored andcommitted
RAS/AMD/ATL: Return error codes from helper functions
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>
1 parent 3a86608 commit 6553c68

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

drivers/ras/amd/atl/core.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ MODULE_DEVICE_TABLE(x86cpu, amd_atl_cpuids);
194194

195195
static int __init amd_atl_init(void)
196196
{
197+
int ret;
198+
197199
if (!x86_match_cpu(amd_atl_cpuids))
198200
return -ENODEV;
199201

@@ -202,8 +204,9 @@ static int __init amd_atl_init(void)
202204

203205
check_for_legacy_df_access();
204206

205-
if (get_df_system_info())
206-
return -ENODEV;
207+
ret = get_df_system_info();
208+
if (ret)
209+
return ret;
207210

208211
/* Increment this module's recount so that it can't be easily unloaded. */
209212
__module_get(THIS_MODULE);

drivers/ras/amd/atl/system.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,13 @@ static void dump_df_cfg(void)
288288

289289
int get_df_system_info(void)
290290
{
291-
if (determine_df_rev()) {
291+
int ret;
292+
293+
ret = determine_df_rev();
294+
if (ret) {
292295
pr_warn("Failed to determine DF Revision");
293296
df_cfg.rev = UNKNOWN;
294-
return -EINVAL;
297+
return ret;
295298
}
296299

297300
apply_node_id_shift();

0 commit comments

Comments
 (0)