summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoryamaguchi <yamaguchi@NetBSD.org>2023-03-23 01:46:30 +0000
committeryamaguchi <yamaguchi@NetBSD.org>2023-03-23 01:46:30 +0000
commit641c86de166845b41ba2ea86ce95e35810119ce5 (patch)
treeaf22d6268342511ce7a9473c1a297133794f4643 /sys/dev
parentede713866e4e1b7cec065b700901e1610d1d7280 (diff)
vioif(4): fix missing virtio_enqueue_abort for error handling
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_vioif.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/pci/if_vioif.c b/sys/dev/pci/if_vioif.c
index e185fbab78b..0a1a3a25f08 100644
--- a/sys/dev/pci/if_vioif.c
+++ b/sys/dev/pci/if_vioif.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vioif.c,v 1.89 2023/03/23 01:42:32 yamaguchi Exp $ */
+/* $NetBSD: if_vioif.c,v 1.90 2023/03/23 01:46:30 yamaguchi Exp $ */
/*
* Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.89 2023/03/23 01:42:32 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.90 2023/03/23 01:46:30 yamaguchi Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -1545,11 +1545,13 @@ vioif_populate_rx_mbufs_locked(struct vioif_softc *sc, struct vioif_rxqueue *rxq
if (m == NULL) {
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL) {
+ virtio_enqueue_abort(vsc, vq, slot);
rxq->rxq_mbuf_enobufs.ev_count++;
break;
}
MCLGET(m, M_DONTWAIT);
if ((m->m_flags & M_EXT) == 0) {
+ virtio_enqueue_abort(vsc, vq, slot);
m_freem(m);
rxq->rxq_mbuf_enobufs.ev_count++;
break;
@@ -1562,6 +1564,7 @@ vioif_populate_rx_mbufs_locked(struct vioif_softc *sc, struct vioif_rxqueue *rxq
rxq->rxq_dmamaps[slot], m, BUS_DMA_READ | BUS_DMA_NOWAIT);
if (r != 0) {
+ virtio_enqueue_abort(vsc, vq, slot);
m_freem(m);
rxq->rxq_mbuf_load_failed.ev_count++;
break;