Skip to content

Commit

Permalink
ath9k: Check for NULL sta in ath_tx_start
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Greear authored and John W. Linville committed Dec 8, 2010
1 parent 80d7e40 commit a9927ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/wireless/ath/ath9k/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a9927ba

Please sign in to comment.