summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2024-05-20 21:22:44 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2024-05-20 21:22:44 +0000
commita89d899f8e89c8221881a56f4297c3704f46c454 (patch)
tree362bf4f39b3cd8b209ff3381974e098a80ec3a9b /sys/dev
parentc30551ea75ad091295ff00942925a2f61df1dd04 (diff)
Fix an off by one.
OK miod@, claudio@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_mwx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/if_mwx.c b/sys/dev/pci/if_mwx.c
index 698b83d95d4..9b3466abcb0 100644
--- a/sys/dev/pci/if_mwx.c
+++ b/sys/dev/pci/if_mwx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mwx.c,v 1.2 2024/02/21 12:08:05 jsg Exp $ */
+/* $OpenBSD: if_mwx.c,v 1.3 2024/05/20 21:22:43 martijn Exp $ */
/*
* Copyright (c) 2022 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2021 MediaTek Inc.
@@ -1426,7 +1426,7 @@ mwx_txwi_alloc(struct mwx_softc *sc, int count)
}
}
- for (i = count; i >= MT_PACKET_ID_FIRST; i--)
+ for (i = count - 1; i >= MT_PACKET_ID_FIRST; i--)
LIST_INSERT_HEAD(&q->mt_freelist, &q->mt_data[i], mt_entry);
return 0;