From: kevlo Date: Tue, 23 Nov 2021 01:44:44 +0000 (+0000) Subject: Fix mbuf leaks after reception error in rge_rxeof(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=67d345debd90ae5582044c0def20f560beeeeb00;p=openbsd 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@ --- 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; }