iwlwifi: warn if firmware image doesn't exist

If the firmware image that we attempt to load doesn't
actually exist we have a broken firmware file or other
code not checking things correctly, so warn in such a
case. Also avoid assigning cur_ucode/ucode_loaded then.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
这个提交包含在:
Johannes Berg
2013-10-25 12:32:51 +02:00
提交者 Emmanuel Grumbach
父节点 cbb346f2fc
当前提交 befe9b6fd8
修改 2 个文件,包含 7 行新增10 行删除

查看文件

@@ -151,13 +151,11 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,
enum iwl_ucode_type old_type = mvm->cur_ucode;
static const u8 alive_cmd[] = { MVM_ALIVE };
mvm->cur_ucode = ucode_type;
fw = iwl_get_ucode_image(mvm, ucode_type);
mvm->ucode_loaded = false;
if (!fw)
if (WARN_ON(!fw))
return -EINVAL;
mvm->cur_ucode = ucode_type;
mvm->ucode_loaded = false;
iwl_init_notification_wait(&mvm->notif_wait, &alive_wait,
alive_cmd, ARRAY_SIZE(alive_cmd),