From 5027f4220fadd3ec2c3076e7157a7c0cc07d0b48 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Sat, 28 Sep 2024 14:51:17 -0400 Subject: [PATCH] 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 Signed-off-by: Sean Khan --- ...x-NULL-pointer-access-Klocwork-issue.patch | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 package/kernel/mac80211/patches/nss/subsys/999-918-mac80211-fix-NULL-pointer-access-Klocwork-issue.patch diff --git a/package/kernel/mac80211/patches/nss/subsys/999-918-mac80211-fix-NULL-pointer-access-Klocwork-issue.patch b/package/kernel/mac80211/patches/nss/subsys/999-918-mac80211-fix-NULL-pointer-access-Klocwork-issue.patch new file mode 100644 index 0000000000..4da3528952 --- /dev/null +++ b/package/kernel/mac80211/patches/nss/subsys/999-918-mac80211-fix-NULL-pointer-access-Klocwork-issue.patch @@ -0,0 +1,62 @@ +From f5a907934f596f77b4c59e549eff5d56b1a4e226 Mon Sep 17 00:00:00 2001 +From: Monika Korada +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 +--- + 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: