From: Pontus Fuchs Date: Mon, 5 Nov 2012 20:17:51 +0000 (+0100) Subject: ar5523: Don't dereference sta if NULL X-Git-Tag: v3.8~351^2~17^2~231 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ee01b30fdc85a4ab5b0836ad98ac0ae5092fb4f;p=platform%2Fkernel%2Flinux-amlogic.git ar5523: Don't dereference sta if NULL A missing else caused a potential NULL dereference. Reported-by: Yuanhan Liu Signed-off-by: Pontus Fuchs Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ar5523/ar5523.c b/drivers/net/wireless/ath/ar5523/ar5523.c index 4bd7714..7157f7d 100644 --- a/drivers/net/wireless/ath/ar5523/ar5523.c +++ b/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);