Skip to content

Commit

Permalink
iwlwifi: fix possible NULL dereference in iwl_set_rate()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Saleem Abdulrasool authored and John W. Linville committed Nov 30, 2007
1 parent d9f8bcb commit c4ba962
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c4ba962

Please sign in to comment.