diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-05-13 23:44:42 +0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-05-17 01:13:45 +0400 |
commit | 82598b4f43312c01b976e02add9a5205e371f858 (patch) | |
tree | 8f53438636d20c71269932d115e493ecc6ef301f | |
parent | bf0fd5da8afdea8e1b1a2b42b8e9db068fbac96b (diff) | |
download | linux-82598b4f43312c01b976e02add9a5205e371f858.tar.xz |
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: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/nvm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/nvm.c b/drivers/net/wireless/iwlwifi/mvm/nvm.c index b8ec02f89acc..c6c15f21065f 100644 --- a/drivers/net/wireless/iwlwifi/mvm/nvm.c +++ b/drivers/net/wireless/iwlwifi/mvm/nvm.c @@ -231,8 +231,9 @@ int iwl_nvm_init(struct iwl_mvm *mvm) if (ret < 0) return ret; - ret = 0; mvm->nvm_data = iwl_parse_nvm_sections(mvm); + if (!mvm->nvm_data) + return -ENODATA; - return ret; + return 0; } |