Commit befe9b6f authored by Johannes Berg's avatar Johannes Berg Committed by Emmanuel Grumbach
Browse files

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: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent cbb346f2
...@@ -330,15 +330,14 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv, ...@@ -330,15 +330,14 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv,
enum iwl_ucode_type old_type; enum iwl_ucode_type old_type;
static const u8 alive_cmd[] = { REPLY_ALIVE }; static const u8 alive_cmd[] = { REPLY_ALIVE };
old_type = priv->cur_ucode;
priv->cur_ucode = ucode_type;
fw = iwl_get_ucode_image(priv, ucode_type); fw = iwl_get_ucode_image(priv, ucode_type);
if (WARN_ON(!fw))
return -EINVAL;
old_type = priv->cur_ucode;
priv->cur_ucode = ucode_type;
priv->ucode_loaded = false; priv->ucode_loaded = false;
if (!fw)
return -EINVAL;
iwl_init_notification_wait(&priv->notif_wait, &alive_wait, iwl_init_notification_wait(&priv->notif_wait, &alive_wait,
alive_cmd, ARRAY_SIZE(alive_cmd), alive_cmd, ARRAY_SIZE(alive_cmd),
iwl_alive_fn, &alive_data); iwl_alive_fn, &alive_data);
......
...@@ -151,13 +151,11 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm, ...@@ -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; enum iwl_ucode_type old_type = mvm->cur_ucode;
static const u8 alive_cmd[] = { MVM_ALIVE }; static const u8 alive_cmd[] = { MVM_ALIVE };
mvm->cur_ucode = ucode_type;
fw = iwl_get_ucode_image(mvm, ucode_type); fw = iwl_get_ucode_image(mvm, ucode_type);
if (WARN_ON(!fw))
mvm->ucode_loaded = false;
if (!fw)
return -EINVAL; return -EINVAL;
mvm->cur_ucode = ucode_type;
mvm->ucode_loaded = false;
iwl_init_notification_wait(&mvm->notif_wait, &alive_wait, iwl_init_notification_wait(&mvm->notif_wait, &alive_wait,
alive_cmd, ARRAY_SIZE(alive_cmd), alive_cmd, ARRAY_SIZE(alive_cmd),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment