qtnfmac: fix NULL pointer dereference
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Fri, 1 Jun 2018 13:24:08 +0000 (08:24 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 18 Jun 2018 08:55:15 +0000 (11:55 +0300)
commitc1e3f64f87381ed3768b9247ab0cd08b41927da6
treef8ed791583b398e7006d200fdc3e9316e67f1270
parentce397d215ccd07b8ae3f71db689aedb85d56ab40
qtnfmac: fix NULL pointer dereference

In case *vif* is NULL at 655: if (!vif), the execution path jumps to
label out, where *vif* is dereferenced at 679:

if (vif->sta_state == QTNF_STA_CONNECTING)

Fix this by immediately returning when *vif* is NULL instead of
jumping to label out.

Addresses-Coverity-ID: 1469567 ("Dereference after null check")
Fixes: 480daa9cb62c ("qtnfmac: fix invalid STA state on EAPOL failure")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Sergey Matyukevich <sergey.matyukevich.os@quanenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c