This sets both fwrt->uats_valid and returns 0, but in the
static inline it returns 0 without setting uats_valid,
which is confusing and the iwlmvm code misbehaves in this
case.
Since it already sets uats_valid, just remove the extra
return value.
Reported-by: Bjoern A. Zeeb <bz@FreeBSD.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250505215513.e981a7911228.Ic94b5e03e2053a08b84cabeb58ce3b6598fd9fc6@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
 
        return 0;
 }
 
-int iwl_uefi_get_uats_table(struct iwl_trans *trans,
-                           struct iwl_fw_runtime *fwrt)
+void iwl_uefi_get_uats_table(struct iwl_trans *trans,
+                            struct iwl_fw_runtime *fwrt)
 {
        struct uefi_cnv_wlan_uats_data *data;
        int ret;
        data = iwl_uefi_get_verified_variable(trans, IWL_UEFI_UATS_NAME,
                                              "UATS", sizeof(*data), NULL);
        if (IS_ERR(data))
-               return -EINVAL;
+               return;
 
        ret = iwl_uefi_uats_parse(data, fwrt);
-       if (ret < 0) {
+       if (ret < 0)
                IWL_DEBUG_FW(trans, "Cannot read UATS table. rev is invalid\n");
-               kfree(data);
-               return ret;
-       }
-
        kfree(data);
-       return 0;
 }
 IWL_EXPORT_SYMBOL(iwl_uefi_get_uats_table);
 
 
 int iwl_uefi_get_dsm(struct iwl_fw_runtime *fwrt, enum iwl_dsm_funcs func,
                     u32 *value);
 void iwl_uefi_get_sgom_table(struct iwl_trans *trans, struct iwl_fw_runtime *fwrt);
-int iwl_uefi_get_uats_table(struct iwl_trans *trans,
-                           struct iwl_fw_runtime *fwrt);
+void iwl_uefi_get_uats_table(struct iwl_trans *trans,
+                            struct iwl_fw_runtime *fwrt);
 int iwl_uefi_get_puncturing(struct iwl_fw_runtime *fwrt);
 int iwl_uefi_get_dsbr(struct iwl_fw_runtime *fwrt, u32 *value);
 int iwl_uefi_get_phy_filters(struct iwl_fw_runtime *fwrt);
 {
 }
 
-static inline
-int iwl_uefi_get_uats_table(struct iwl_trans *trans,
-                           struct iwl_fw_runtime *fwrt)
+static inline void
+iwl_uefi_get_uats_table(struct iwl_trans *trans, struct iwl_fw_runtime *fwrt)
 {
-       return 0;
 }
 
 static inline
 
                /* we don't fail if the table is not available */
        }
 
-       ret = iwl_uefi_get_uats_table(mld->trans, &mld->fwrt);
-       if (ret)
-               IWL_DEBUG_RADIO(mld, "failed to read UATS table (%d)\n", ret);
+       iwl_uefi_get_uats_table(mld->trans, &mld->fwrt);
 
        iwl_bios_get_phy_filters(&mld->fwrt);
 }
 
                return;
        }
 
-       ret = iwl_uefi_get_uats_table(mvm->trans, &mvm->fwrt);
-       if (ret < 0) {
-               IWL_DEBUG_FW(mvm, "failed to read UATS table (%d)\n", ret);
+       iwl_uefi_get_uats_table(mvm->trans, &mvm->fwrt);
+
+       if (!mvm->fwrt.uats_valid)
                return;
-       }
 
        ret = iwl_mvm_send_cmd(mvm, &cmd);
        if (ret < 0)