From: martijn Date: Mon, 20 May 2024 21:22:43 +0000 (+0000) Subject: Fix an off by one. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=74a3920e6ef96748da754a285f009544ab30930a;p=openbsd Fix an off by one. OK miod@, claudio@ --- 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;