summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2022-08-22 17:07:40 +0000
committerthorpej <thorpej@NetBSD.org>2022-08-22 17:07:40 +0000
commit2378cec4b4a2607ad152b910c785bc19cd968192 (patch)
tree03b2f5f8606d94e0efce63bd148c7cf03f6488a3 /sys/dev
parent74cd1b6701bea60c3bc70446a238593b0ad46610 (diff)
We come into our if_start routine via ether_output(), therefore there is
no need to check-and-pullup to sizeof(struct ether_header). Instead, we can simply assert it.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_ipw.c8
-rw-r--r--sys/dev/pci/if_iwi.c10
2 files changed, 6 insertions, 12 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c
index d0269fd2bba..59755ce59c9 100644
--- a/sys/dev/pci/if_ipw.c
+++ b/sys/dev/pci/if_ipw.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ipw.c,v 1.74 2021/06/16 00:21:18 riastradh Exp $ */
+/* $NetBSD: if_ipw.c,v 1.75 2022/08/22 17:07:40 thorpej Exp $ */
/* FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp */
/*-
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.74 2021/06/16 00:21:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.75 2022/08/22 17:07:40 thorpej Exp $");
/*-
* Intel(R) PRO/Wireless 2100 MiniPCI driver
@@ -1530,9 +1530,7 @@ ipw_start(struct ifnet *ifp)
break;
}
- if (m0->m_len < sizeof (struct ether_header) &&
- (m0 = m_pullup(m0, sizeof (struct ether_header))) == NULL)
- continue;
+ KASSERT(m0->m_len >= sizeof(struct ether_header));
eh = mtod(m0, struct ether_header *);
ni = ieee80211_find_txnode(ic, eh->ether_dhost);
diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c
index 1b6b006f48a..ae5287447ac 100644
--- a/sys/dev/pci/if_iwi.c
+++ b/sys/dev/pci/if_iwi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iwi.c,v 1.118 2022/05/23 13:53:37 rin Exp $ */
+/* $NetBSD: if_iwi.c,v 1.119 2022/08/22 17:07:40 thorpej Exp $ */
/* $OpenBSD: if_iwi.c,v 1.111 2010/11/15 19:11:57 damien Exp $ */
/*-
@@ -19,7 +19,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.118 2022/05/23 13:53:37 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.119 2022/08/22 17:07:40 thorpej Exp $");
/*-
* Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
@@ -1785,11 +1785,7 @@ iwi_start(struct ifnet *ifp)
if (m0 == NULL)
break;
- if (m0->m_len < sizeof (struct ether_header) &&
- (m0 = m_pullup(m0, sizeof (struct ether_header))) == NULL) {
- if_statinc(ifp, if_oerrors);
- continue;
- }
+ KASSERT(m0->m_len >= sizeof(struct ether_header));
eh = mtod(m0, struct ether_header *);
ni = ieee80211_find_txnode(ic, eh->ether_dhost);