Browse Source

ar5523: Don't dereference sta if NULL

A missing else caused a potential NULL dereference.

Reported-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pontus Fuchs 12 years ago
parent
commit
9ee01b30fd
1 changed files with 2 additions and 2 deletions
  1. 2 2
      drivers/net/wireless/ath/ar5523/ar5523.c

+ 2 - 2
drivers/net/wireless/ath/ar5523/ar5523.c

@@ -1196,8 +1196,8 @@ static void ar5523_create_rateset(struct ar5523 *ar,
 	if (!sta) {
 		ar5523_info(ar, "STA not found. Cannot set rates\n");
 		sta_rate_set = bss_conf->basic_rates;
-	}
-	sta_rate_set = sta->supp_rates[ar->hw->conf.channel->band];
+	} else
+		sta_rate_set = sta->supp_rates[ar->hw->conf.channel->band];
 
 	ar5523_dbg(ar, "sta rate_set = %08x\n", sta_rate_set);