From c4ba9621f4f241f8c4d4f620ad4257af59d21f3e Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sun, 18 Nov 2007 23:59:08 -0800 Subject: iwlwifi: fix possible NULL dereference in iwl_set_rate() Signed-off-by: Saleem Abdulrasool Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl3945-base.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c') diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 465da4f67ce7..5751c89857f0 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; -- cgit v1.2.2