aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2007-11-18 23:59:08 -0800
committerJohn W. Linville <linville@tuxdriver.com>2007-11-29 21:34:51 -0500
commitc4ba9621f4f241f8c4d4f620ad4257af59d21f3e (patch)
tree4b195104700f71e41be6ba34968429551ee918d4 /drivers
parentd9f8bcbf67a0ee67c8cb0734f003dfe916bb5248 (diff)
iwlwifi: fix possible NULL dereference in iwl_set_rate()
Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 465da4f67ce..5751c89857f 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2915,6 +2915,10 @@ static void iwl_set_rate(struct iwl_priv *priv)
int i;
hw = iwl_get_hw_mode(priv, priv->phymode);
+ if (!hw) {
+ IWL_ERROR("Failed to set rate: unable to get hw mode\n");
+ return;
+ }
priv->active_rate = 0;
priv->active_rate_basic = 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 9918780f5e8..0b22e017357 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -3003,6 +3003,10 @@ static void iwl_set_rate(struct iwl_priv *priv)
int i;
hw = iwl_get_hw_mode(priv, priv->phymode);
+ if (!hw) {
+ IWL_ERROR("Failed to set rate: unable to get hw mode\n");
+ return;
+ }
priv->active_rate = 0;
priv->active_rate_basic = 0;