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>
static int __init amd_atl_init(void)
{
+ int ret;
+
if (!x86_match_cpu(amd_atl_cpuids))
return -ENODEV;
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);
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();