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>
This commit is contained in:
parent
d9f8bcbf67
commit
c4ba9621f4
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue