aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEN-WEU WU <enweiwu@FreeBSD.org>2026-06-16 14:34:39 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2026-06-16 14:34:39 +0000
commit9ef75e05ba91b72c10a411fdd21fa5ca98efa0c9 (patch)
tree3eb09b7f653a6032e688ba2e48a4abb5ba0c6eca
parent76f9bb488e77ae4cc220b0bbbc53f1a7315ef977 (diff)
wtap: Remove bogus NULL check in wtap_transmit
The node pointer is guaranteed to be non-NULL by the net80211 stack. The original check was also ineffective as it dereferenced ni->ni_vap before the NULL check. Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D54547
-rw-r--r--sys/dev/wtap/if_wtap.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/dev/wtap/if_wtap.c b/sys/dev/wtap/if_wtap.c
index 376b63e38f2b..51733a05bd93 100644
--- a/sys/dev/wtap/if_wtap.c
+++ b/sys/dev/wtap/if_wtap.c
@@ -601,12 +601,8 @@ wtap_transmit(struct ieee80211com *ic, struct mbuf *m)
struct ieee80211vap *vap = ni->ni_vap;
struct wtap_vap *avp = WTAP_VAP(vap);
- if(ni == NULL){
- printf("m->m_pkthdr.rcvif is NULL we can't radiotap_tx\n");
- }else{
- if (ieee80211_radiotap_active_vap(vap))
- ieee80211_radiotap_tx(vap, m);
- }
+ if (ieee80211_radiotap_active_vap(vap))
+ ieee80211_radiotap_tx(vap, m);
if (m->m_flags & M_TXCB)
ieee80211_process_callback(ni, m, 0);
ieee80211_free_node(ni);