diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-03-27 10:06:29 +0200 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-04-13 09:36:03 +0300 |
commit | 748fa67cb76608457d03f3932874b9baddb4d8bf (patch) | |
tree | 14711b2009c6f780fe93f2fbd227f0a440265695 /drivers/net/wireless/iwlwifi/mvm/scan.c | |
parent | 757cf23b4b4bcede8ffb40947536fbc8722567ab (diff) | |
download | lwn-748fa67cb76608457d03f3932874b9baddb4d8bf.tar.gz lwn-748fa67cb76608457d03f3932874b9baddb4d8bf.zip |
iwlwifi: mvm: replace BUG_ON by WARN_ON in scan.c
While the scan_cmd should really be allocated in init (and
we do fail init in case the allocation failed), it doesn't
mean we should lock up the machine if something really bad
happened.
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/scan.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/scan.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index c91dc8498852..9e760d0c5985 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c @@ -348,7 +348,10 @@ int iwl_mvm_scan_request(struct iwl_mvm *mvm, struct iwl_mvm_scan_params params = {}; lockdep_assert_held(&mvm->mutex); - BUG_ON(mvm->scan_cmd == NULL); + + /* we should have failed registration if scan_cmd was NULL */ + if (WARN_ON(mvm->scan_cmd == NULL)) + return -ENOMEM; IWL_DEBUG_SCAN(mvm, "Handling mac80211 scan request\n"); mvm->scan_status = IWL_MVM_SCAN_OS; |