diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2010-01-03 06:41:23 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2010-01-03 06:41:23 +0000 |
commit | f237769b46c16ab0a5d0a718f379ef00b1f0cedf (patch) | |
tree | 130fbe42cf40ea07b645ce1e958cb1964f1edf58 /sys/dev/ic | |
parent | b235f6ada93faaba25d7af7deefa22fac9242454 (diff) |
dont leak a ccb if we fail to get a reply in portenable
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/mpi.c | 11 |
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 |