git: 9ef75e05ba91 - main - wtap: Remove bogus NULL check in wtap_transmit
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 16 Jun 2026 14:58:20 UTC
The branch main has been updated by adrian:
URL: https://cgit.FreeBSD.org/src/commit/?id=9ef75e05ba91b72c10a411fdd21fa5ca98efa0c9
commit 9ef75e05ba91b72c10a411fdd21fa5ca98efa0c9
Author: EN-WEU WU <enweiwu@FreeBSD.org>
AuthorDate: 2026-06-16 14:34:39 +0000
Commit: Adrian Chadd <adrian@FreeBSD.org>
CommitDate: 2026-06-16 14:34:39 +0000
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
---
sys/dev/wtap/if_wtap.c | 8 ++------
1 file 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);