Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net80211 Get rid of invalid KASSERT



details:   https://anonhg.NetBSD.org/src/rev/4cf0374cd666
branches:  trunk
changeset: 816188:4cf0374cd666
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Jun 20 08:57:18 2016 +0000

description:
Get rid of invalid KASSERT

The mbuf being checked is allocated in ieee80211_getmgtframe just above,
so checking NULL of its CTX is meaningless.

Pointed out by mlelstv@

diffstat:

 sys/net80211/ieee80211_output.c |  8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diffs (36 lines):

diff -r 67878db15997 -r 4cf0374cd666 sys/net80211/ieee80211_output.c
--- a/sys/net80211/ieee80211_output.c   Mon Jun 20 08:34:59 2016 +0000
+++ b/sys/net80211/ieee80211_output.c   Mon Jun 20 08:57:18 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ieee80211_output.c,v 1.55 2016/06/20 08:30:59 knakahara Exp $  */
+/*     $NetBSD: ieee80211_output.c,v 1.56 2016/06/20 08:57:18 ozaki-r Exp $    */
 /*-
  * Copyright (c) 2001 Atsushi Onoe
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.34 2005/08/10 16:22:29 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.55 2016/06/20 08:30:59 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.56 2016/06/20 08:57:18 ozaki-r Exp $");
 #endif
 
 #ifdef _KERNEL_OPT
@@ -184,9 +184,6 @@
        M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT);
        if (m == NULL)
                return ENOMEM;
-#ifdef __FreeBSD__
-       KASSERT(M_GETCTX(m, struct ieee80211_node *) == NULL);
-#endif
        M_SETCTX(m, ni);
 
        wh = mtod(m, struct ieee80211_frame *);
@@ -1344,7 +1341,6 @@
        M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT);
        if (m == NULL)
                return ENOMEM;
-       KASSERT(M_GETCTX(m, struct ieee80211_node *) == NULL);
        M_SETCTX(m, ni);
 
        wh = mtod(m, struct ieee80211_frame *);



Home | Main Index | Thread Index | Old Index