From: Roland Vossen Date: Thu, 10 Mar 2011 10:35:07 +0000 (+0100) Subject: staging: brcm80211: bugfix for control.sta NULL ptr dereference X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8ada0be34014565dc4e57d1194d18594a5bcd161;p=linux-beck.git staging: brcm80211: bugfix for control.sta NULL ptr dereference Mac80211 can transmit packets where the control.sta field is NULL. The driver dereferenced this. Bugfix was to only dereference a non NULL ieee80211_sta pointer. Signed-off-by: Roland Vossen Reviewed-by: Arend van Spriel Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_main.c b/drivers/staging/brcm80211/brcmsmac/wlc_main.c index cb1e1428cd87..8bee149f6316 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_main.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_main.c @@ -6613,7 +6613,8 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2) tx_info = IEEE80211_SKB_CB(p); h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN); - scb = (struct scb *)tx_info->control.sta->drv_priv; + if (tx_info->control.sta) + scb = (struct scb *)tx_info->control.sta->drv_priv; if (N_ENAB(wlc->pub)) { u8 *plcp = (u8 *) (txh + 1);