ath9k: Check for NULL sta in ath_tx_start

It can be NULL according to docs, and logging showed it
to be NULL in practice.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Ben Greear 2010-12-06 21:13:49 -08:00 коммит произвёл John W. Linville
Родитель 80d7e403c9
Коммит a9927ba3c5
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -1740,7 +1740,10 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
int frmlen = skb->len + FCS_LEN;
int q;
txctl->an = (struct ath_node *)sta->drv_priv;
/* NOTE: sta can be NULL according to net/mac80211.h */
if (sta)
txctl->an = (struct ath_node *)sta->drv_priv;
if (info->control.hw_key)
frmlen += info->control.hw_key->icv_len;