summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2010-01-03 06:41:22 +0000
committerdlg <dlg@openbsd.org>2010-01-03 06:41:22 +0000
commit52bc9f3dd23c3deb41a1b126d92b0cf0fd7ffb49 (patch)
tree67f3e3bb9d760afbbc0405001002d7fb3843e28a
parentwhen getting a reply from the hw, only sync the dmamem for that one reply (diff)
downloadwireguard-openbsd-52bc9f3dd23c3deb41a1b126d92b0cf0fd7ffb49.tar.xz
wireguard-openbsd-52bc9f3dd23c3deb41a1b126d92b0cf0fd7ffb49.zip
dont leak a ccb if we fail to get a reply in portenable
-rw-r--r--sys/dev/ic/mpi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index 2d1737b384e..cff3af3e27c 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.126 2010/01/03 06:36:50 dlg Exp $ */
+/* $OpenBSD: mpi.c,v 1.127 2010/01/03 06:41:22 dlg Exp $ */
/*
* Copyright (c) 2005, 2006, 2009 David Gwynne <dlg@openbsd.org>
@@ -2284,6 +2284,7 @@ mpi_portenable(struct mpi_softc *sc)
{
struct mpi_ccb *ccb;
struct mpi_msg_portenable_request *peq;
+ int rv = 0;
DNPRINTF(MPI_D_MISC, "%s: mpi_portenable\n", DEVNAME(sc));
@@ -2309,13 +2310,13 @@ mpi_portenable(struct mpi_softc *sc)
if (ccb->ccb_rcb == NULL) {
DNPRINTF(MPI_D_MISC, "%s: empty portenable reply\n",
DEVNAME(sc));
- return (1);
- }
+ rv = 1;
+ } else
+ mpi_push_reply(sc, ccb->ccb_rcb);
- mpi_push_reply(sc, ccb->ccb_rcb);
mpi_put_ccb(sc, ccb);
- return (0);
+ return (rv);
}
int