提交 82598b4f 编写于 作者: J Johannes Berg

iwlwifi: mvm: fix NVM parsing error path

If NVM parsing fails and returns NULL, we continue in
the code flow and eventually crash accessing the NULL
pointer. Return an error from iwl_nvm_init() if the
parsing failed.
Reviewed-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 bf0fd5da
...@@ -231,8 +231,9 @@ int iwl_nvm_init(struct iwl_mvm *mvm) ...@@ -231,8 +231,9 @@ int iwl_nvm_init(struct iwl_mvm *mvm)
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = 0;
mvm->nvm_data = iwl_parse_nvm_sections(mvm); mvm->nvm_data = iwl_parse_nvm_sections(mvm);
if (!mvm->nvm_data)
return -ENODATA;
return ret; return 0;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册