diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-03-27 07:06:34 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-03-27 07:06:34 +0000 |
commit | be4003f042ed9e94a96ea33b4699ab576af838ae (patch) | |
tree | 5441ea619b537b4ac05fdbd83227e768f0281d2c | |
parent | b97b58c23eb96da709b760a7a2a40496e0d328cb (diff) |
you want the ring to wrap when it gets to the size of the ring, not one
after it.
jmatthew@ figured out i am bad at c.
-rw-r--r-- | sys/dev/pci/mpii.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c index 31dbe9bf87c..1cea9b9d75e 100644 --- a/sys/dev/pci/mpii.c +++ b/sys/dev/pci/mpii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpii.c,v 1.85 2014/03/27 05:53:37 dlg Exp $ */ +/* $OpenBSD: mpii.c,v 1.86 2014/03/27 07:06:33 dlg Exp $ */ /* * Copyright (c) 2010, 2012 Mike Belopuhov * Copyright (c) 2009 James Giannoules @@ -1331,7 +1331,7 @@ mpii_push_reply(struct mpii_softc *sc, struct mpii_rcb *rcb) rfp = MPII_DMA_KVA(sc->sc_reply_freeq); htolem32(&rfp[idx], rcb->rcb_reply_dva); - if (++idx > sc->sc_reply_free_qdepth) + if (++idx >= sc->sc_reply_free_qdepth) idx = 0; mpii_write_reply_free(sc, sc->sc_reply_free_host_index = idx); |