Commit c1e3f64f authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Kalle Valo

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: 480daa9c ("qtnfmac: fix invalid STA state on EAPOL failure")
Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: default avatarSergey Matyukevich <sergey.matyukevich.os@quanenna.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent ce397d21
...@@ -654,8 +654,7 @@ qtnf_disconnect(struct wiphy *wiphy, struct net_device *dev, ...@@ -654,8 +654,7 @@ qtnf_disconnect(struct wiphy *wiphy, struct net_device *dev,
vif = qtnf_mac_get_base_vif(mac); vif = qtnf_mac_get_base_vif(mac);
if (!vif) { if (!vif) {
pr_err("MAC%u: primary VIF is not configured\n", mac->macid); pr_err("MAC%u: primary VIF is not configured\n", mac->macid);
ret = -EFAULT; return -EFAULT;
goto out;
} }
if (vif->wdev.iftype != NL80211_IFTYPE_STATION) { if (vif->wdev.iftype != NL80211_IFTYPE_STATION) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment