diff options
| author | msaitoh <msaitoh@NetBSD.org> | 2022-05-17 00:02:57 +0000 |
|---|---|---|
| committer | msaitoh <msaitoh@NetBSD.org> | 2022-05-17 00:02:57 +0000 |
| commit | a0199cc7bcb1161dc43f9833b1aa9f32882fed23 (patch) | |
| tree | 070b40d664c541bfde4723d6c15e9d9c1472a857 /sys/dev | |
| parent | 9956fabd1eaefe89dbae117a22f0631f3183649e (diff) | |
Call m_freem(m) only if m0 == NULL.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/pci/if_wm.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/pci/if_wm.c b/sys/dev/pci/if_wm.c index f531e379003..c808b63de21 100644 --- a/sys/dev/pci/if_wm.c +++ b/sys/dev/pci/if_wm.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.730 2022/05/03 00:23:33 gutteridge Exp $ */ +/* $NetBSD: if_wm.c,v 1.731 2022/05/17 00:02:57 msaitoh Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -82,7 +82,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.730 2022/05/03 00:23:33 gutteridge Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.731 2022/05/17 00:02:57 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -8016,9 +8016,10 @@ wm_send_common_locked(struct ifnet *ifp, struct wm_txqueue *txq, * increment successed packet counter as in the case * which the packet is discarded by link down PHY. */ - if (m0 != NULL) + if (m0 != NULL) { if_statinc(ifp, if_opackets); - m_freem(m0); + m_freem(m0); + } } while (m0 != NULL); return; } @@ -8633,9 +8634,10 @@ wm_nq_send_common_locked(struct ifnet *ifp, struct wm_txqueue *txq, * increment successed packet counter as in the case * which the packet is discarded by link down PHY. */ - if (m0 != NULL) + if (m0 != NULL) { if_statinc(ifp, if_opackets); - m_freem(m0); + m_freem(m0); + } } while (m0 != NULL); return; } |
