summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2006-06-12 12:31:58 +0000
committerdlg <dlg@openbsd.org>2006-06-12 12:31:58 +0000
commitc00bbc89c73b0b3c1777d5088f4d999a9ccb3a82 (patch)
treec9487fc38bb4973a0ebaed30e3b608778710180a
parent- make the sub-sections a little more consistent in naming (diff)
downloadwireguard-openbsd-c00bbc89c73b0b3c1777d5088f4d999a9ccb3a82.tar.xz
wireguard-openbsd-c00bbc89c73b0b3c1777d5088f4d999a9ccb3a82.zip
reset the reply pointer to NULL every time we get a context reply in
mpi_interrupt and mpi_completion. if we got an address reply followed by a context reply we used to pass that same reply to both completion routines.
-rw-r--r--sys/dev/ic/mpi.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index 9235e12e108..ef2a1679f11 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.33 2006/06/12 03:55:39 dlg Exp $ */
+/* $OpenBSD: mpi.c,v 1.34 2006/06/12 12:31:58 dlg Exp $ */
/*
* Copyright (c) 2005, 2006 David Gwynne <dlg@openbsd.org>
@@ -475,7 +475,7 @@ mpi_intr(void *arg)
{
struct mpi_softc *sc = arg;
struct mpi_ccb *ccb;
- struct mpi_msg_reply *reply = NULL;
+ struct mpi_msg_reply *reply;
u_int32_t reply_dva;
char *reply_addr;
u_int32_t reg, id;
@@ -513,6 +513,8 @@ mpi_intr(void *arg)
panic("%s: unsupported context reply\n",
DEVNAME(sc));
}
+
+ reply = NULL;
}
DNPRINTF(MPI_D_INTR, "%s: mpi_intr id: %d\n", DEVNAME(sc), id);
@@ -738,7 +740,7 @@ int
mpi_complete(struct mpi_softc *sc, struct mpi_ccb *nccb, int timeout)
{
struct mpi_ccb *ccb;
- struct mpi_msg_reply *reply = NULL;
+ struct mpi_msg_reply *reply;
u_int32_t reply_dva;
char *reply_addr;
u_int32_t reg, id = 0xffffffff;
@@ -786,6 +788,8 @@ mpi_complete(struct mpi_softc *sc, struct mpi_ccb *nccb, int timeout)
panic("%s: unsupported context reply\n",
DEVNAME(sc));
}
+
+ reply = NULL;
}
DNPRINTF(MPI_D_INTR, "%s: mpi_complete id: %d\n",