mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 06:04:23 +08:00
wifi: iwlwifi: read BIOS PNVM only for non-Intel SKU
The driver is supposed to read the PNVM from BIOS only for non-Intel
SKUs. For Intel SKUs the OEM ID will be 0.
Read BIOS PNVM only when a non-Intel SKU is indicated.
Fixes: b99e32cbfd
("wifi: iwlwifi: Take loading and setting of pnvm image out of parsing part")
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240131091413.3625cf1223d3.Ieffda5f506713b1c979388dd7a0e1c1a0145cfca@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
cfbb2add48
commit
c868a189ec
@ -268,21 +268,27 @@ static u8 *iwl_get_pnvm_image(struct iwl_trans *trans_p, size_t *len)
|
|||||||
struct pnvm_sku_package *package;
|
struct pnvm_sku_package *package;
|
||||||
u8 *image = NULL;
|
u8 *image = NULL;
|
||||||
|
|
||||||
/* First attempt to get the PNVM from BIOS */
|
/* Get PNVM from BIOS for non-Intel SKU */
|
||||||
package = iwl_uefi_get_pnvm(trans_p, len);
|
if (trans_p->sku_id[2]) {
|
||||||
if (!IS_ERR_OR_NULL(package)) {
|
package = iwl_uefi_get_pnvm(trans_p, len);
|
||||||
if (*len >= sizeof(*package)) {
|
if (!IS_ERR_OR_NULL(package)) {
|
||||||
/* we need only the data */
|
if (*len >= sizeof(*package)) {
|
||||||
*len -= sizeof(*package);
|
/* we need only the data */
|
||||||
image = kmemdup(package->data, *len, GFP_KERNEL);
|
*len -= sizeof(*package);
|
||||||
|
image = kmemdup(package->data,
|
||||||
|
*len, GFP_KERNEL);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* free package regardless of whether kmemdup
|
||||||
|
* succeeded
|
||||||
|
*/
|
||||||
|
kfree(package);
|
||||||
|
if (image)
|
||||||
|
return image;
|
||||||
}
|
}
|
||||||
/* free package regardless of whether kmemdup succeeded */
|
|
||||||
kfree(package);
|
|
||||||
if (image)
|
|
||||||
return image;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If it's not available, try from the filesystem */
|
/* If it's not available, or for Intel SKU, try from the filesystem */
|
||||||
if (iwl_pnvm_get_from_fs(trans_p, &image, len))
|
if (iwl_pnvm_get_from_fs(trans_p, &image, len))
|
||||||
return NULL;
|
return NULL;
|
||||||
return image;
|
return image;
|
||||||
|
Loading…
Reference in New Issue
Block a user