* [PATCH][net-next] mac80211: add missing null return check from call to ieee80211_get_sband
@ 2019-07-30 14:32 Colin King
0 siblings, 0 replies; only message in thread
From: Colin King @ 2019-07-30 14:32 UTC (permalink / raw)
To: John Crispin, Johannes Berg, David S . Miller, linux-wireless, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
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: 2ab45876756f ("mac80211: add support for the ADDBA extension element")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
net/mac80211/agg-rx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index 0e1bb43973b8..4d1c335e06e5 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -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;
--
2.20.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-07-30 14:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-30 14:32 [PATCH][net-next] mac80211: add missing null return check from call to ieee80211_get_sband Colin King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).