diff options
author | Kevin Lo <kevlo@cvs.openbsd.org> | 2021-11-23 01:44:45 +0000 |
---|---|---|
committer | Kevin Lo <kevlo@cvs.openbsd.org> | 2021-11-23 01:44:45 +0000 |
commit | d547afd4268dcd00966b6d4d6697c083b2b1f2fb (patch) | |
tree | d2196ab04d88f121ef783ed69ba194d24ab8bde1 /sys | |
parent | fbd89330792f7c0848059311a4ca4e4feb7940b8 (diff) |
Fix mbuf leaks after reception error in rge_rxeof().
Being that rge(4) is derived from re(4) it looks like it has the same
issues as fixed in re(4) rev 1.211.
From Brad
ok gnezdo@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_rge.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/if_rge.c b/sys/dev/pci/if_rge.c index 6d54456678d..4ef95f6b65e 100644 --- a/sys/dev/pci/if_rge.c +++ b/sys/dev/pci/if_rge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rge.c,v 1.15 2021/08/16 01:30:27 kevlo Exp $ */ +/* $OpenBSD: if_rge.c,v 1.16 2021/11/23 01:44:44 kevlo Exp $ */ /* * Copyright (c) 2019, 2020 Kevin Lo <kevlo@openbsd.org> @@ -1223,6 +1223,8 @@ rge_rxeof(struct rge_queues *q) if ((rxstat & (RGE_RDCMDSTS_SOF | RGE_RDCMDSTS_EOF)) != (RGE_RDCMDSTS_SOF | RGE_RDCMDSTS_EOF)) { + ifp->if_ierrors++; + m_freem(m); rge_discard_rxbuf(q, i); continue; } @@ -1237,6 +1239,7 @@ rge_rxeof(struct rge_queues *q) m_freem(q->q_rx.rge_head); q->q_rx.rge_head = q->q_rx.rge_tail = NULL; } + m_freem(m); rge_discard_rxbuf(q, i); continue; } |