From a89d899f8e89c8221881a56f4297c3704f46c454 Mon Sep 17 00:00:00 2001 From: Martijn van Duren Date: Mon, 20 May 2024 21:22:44 +0000 Subject: Fix an off by one. OK miod@, claudio@ --- sys/dev/pci/if_mwx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev') 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 * 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; -- cgit v1.2.3