wifi: iwlwifi: uefi: check DSM item validity

The first array index is a bitmap indicating which of the
other values are valid. Check that bitmap before returning
a value.

Fixes: fc7214c3c9 ("wifi: iwlwifi: read DSM functions from UEFI")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220085
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250828095500.59ec52ff865e.I9e11f497a029eb38f481b2c90c43c0935285216d@changeid
This commit is contained in:
Johannes Berg 2025-08-28 09:55:28 +03:00 committed by Miri Korenblit
parent 7bf2dfccc2
commit 1d33694462

View File

@ -747,6 +747,12 @@ int iwl_uefi_get_dsm(struct iwl_fw_runtime *fwrt, enum iwl_dsm_funcs func,
goto out;
}
if (!(data->functions[DSM_FUNC_QUERY] & BIT(func))) {
IWL_DEBUG_RADIO(fwrt, "DSM func %d not in 0x%x\n",
func, data->functions[DSM_FUNC_QUERY]);
goto out;
}
*value = data->functions[func];
IWL_DEBUG_RADIO(fwrt,