From f237769b46c16ab0a5d0a718f379ef00b1f0cedf Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Sun, 3 Jan 2010 06:41:23 +0000 Subject: dont leak a ccb if we fail to get a reply in portenable --- sys/dev/ic/mpi.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'sys/dev/ic') 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 @@ -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 -- cgit v1.2.3