From 67d345debd90ae5582044c0def20f560beeeeb00 Mon Sep 17 00:00:00 2001 From: kevlo Date: Tue, 23 Nov 2021 01:44:44 +0000 Subject: [PATCH] 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@ --- sys/dev/pci/if_rge.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 @@ -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; } -- 2.20.1