Skip to content

Commit

Permalink
mac80211: add missing null return check from call to ieee80211_get_sband
Browse files Browse the repository at this point in the history
The return from ieee80211_get_sband can potentially be a null pointer, so
it seems prudent to add a null check to avoid a null pointer dereference
on sband.

Addresses-Coverity: ("Dereference null return")
Fixes: 2ab4587 ("mac80211: add support for the ADDBA extension element")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190730143205.14261-1-colin.king@canonical.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Colin Ian King authored and Johannes Berg committed Jul 31, 2019
1 parent 2ab4587 commit f12cac5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/mac80211/agg-rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ static void ieee80211_add_addbaext(struct ieee80211_sub_if_data *sdata,
u8 *pos;

sband = ieee80211_get_sband(sdata);
if (!sband)
return;
he_cap = ieee80211_get_he_iftype_cap(sband, sdata->vif.type);
if (!he_cap)
return;
Expand Down

0 comments on commit f12cac5

Please sign in to comment.