mirror of
https://github.com/breeze303/openwrt-ipq.git
synced 2025-12-16 21:51:07 +00:00
ath11k_nss: mac80211: fix NULL pointer access, Klocwork issue
Currently we are dereferencing dev pointer without a NULL check. Fix this issue by adding a NULL check. Patch-dependency: none Patch-work: none Fixes: 4b7afb52c8e2 (mac80211: reorganize code to remove a forward declaration) Note: ath.git commit id is mentioned in the Fixes tag Signed-off-by: Monika Korada <quic_koramoni@quicinc.com> Signed-off-by: Sean Khan <datapronix@protonmail.com>
This commit is contained in:
parent
0e34b6ef70
commit
5027f4220f
@ -0,0 +1,62 @@
|
||||
From f5a907934f596f77b4c59e549eff5d56b1a4e226 Mon Sep 17 00:00:00 2001
|
||||
From: Monika Korada <quic_koramoni@quicinc.com>
|
||||
Date: Mon, 27 May 2024 11:32:49 +0530
|
||||
Subject: [PATCH] KW: wifi: mac80211: fix NULL pointer access, Klocwork issue
|
||||
|
||||
Currently we are dereferencing dev pointer without a NULL
|
||||
check.
|
||||
|
||||
Fix this issue by adding a NULL check.
|
||||
|
||||
Patch-dependency: none
|
||||
Patch-work: none
|
||||
Fixes: 4b7afb52c8e2 (mac80211: reorganize code to remove a forward declaration)
|
||||
Note: ath.git commit id is mentioned in the Fixes tag
|
||||
|
||||
Signed-off-by: Monika Korada <quic_koramoni@quicinc.com>
|
||||
---
|
||||
net/mac80211/iface.c | 12 ++++++++----
|
||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/net/mac80211/iface.c
|
||||
+++ b/net/mac80211/iface.c
|
||||
@@ -1348,7 +1348,8 @@ int ieee80211_do_open(struct wireless_de
|
||||
case NL80211_IFTYPE_AP_VLAN:
|
||||
if (sdata->bss->active) {
|
||||
ieee80211_link_vlan_copy_chanctx(&sdata->deflink);
|
||||
- netif_carrier_on(dev);
|
||||
+ if (dev)
|
||||
+ netif_carrier_on(dev);
|
||||
|
||||
if (ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) {
|
||||
ieee80211_set_sdata_offload_flags(sdata);
|
||||
@@ -1359,7 +1360,8 @@ int ieee80211_do_open(struct wireless_de
|
||||
|
||||
ieee80211_set_vif_encap_ops(sdata);
|
||||
} else {
|
||||
- netif_carrier_off(dev);
|
||||
+ if (dev)
|
||||
+ netif_carrier_off(dev);
|
||||
}
|
||||
break;
|
||||
case NL80211_IFTYPE_MONITOR:
|
||||
@@ -1390,7 +1392,8 @@ int ieee80211_do_open(struct wireless_de
|
||||
ieee80211_recalc_offload(local);
|
||||
ieee80211_recalc_idle(local);
|
||||
|
||||
- netif_carrier_on(dev);
|
||||
+ if (dev)
|
||||
+ netif_carrier_on(dev);
|
||||
break;
|
||||
default:
|
||||
if (coming_up) {
|
||||
@@ -1434,7 +1437,8 @@ int ieee80211_do_open(struct wireless_de
|
||||
case NL80211_IFTYPE_AP:
|
||||
case NL80211_IFTYPE_MESH_POINT:
|
||||
case NL80211_IFTYPE_OCB:
|
||||
- netif_carrier_off(dev);
|
||||
+ if (dev)
|
||||
+ netif_carrier_off(dev);
|
||||
break;
|
||||
case NL80211_IFTYPE_P2P_DEVICE:
|
||||
case NL80211_IFTYPE_NAN:
|
||||
Loading…
Reference in New Issue
Block a user