summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2013-05-07 01:54:07 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2013-05-07 01:54:07 +0000
commit490371a9c5e671363aad96a473b6fc091ee360d6 (patch)
tree6b6b5402cd359f1ec80ee90051a66f439e6d55a4 /sys/dev/ic
parent221fa9d05558a19d5c9834fa1890782472c210fb (diff)
fix a double free in an error path
reminded of this diff by a report from Arto Jonsson ok krw@ fgsch@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/ami.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c
index a42bae451e2..46b7c2e97ba 100644
--- a/sys/dev/ic/ami.c
+++ b/sys/dev/ic/ami.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ami.c,v 1.223 2012/01/09 18:50:44 deraadt Exp $ */
+/* $OpenBSD: ami.c,v 1.224 2013/05/07 01:54:06 jsg Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
@@ -496,13 +496,13 @@ ami_attach(struct ami_softc *sc)
sc->sc_link.openings = sc->sc_maxcmds;
}
- ami_freemem(sc, am);
-
if (ami_alloc_ccbs(sc, AMI_MAXCMDS + 1) != 0) {
/* error already printed */
goto free_mbox;
}
+ ami_freemem(sc, am);
+
/* hack for hp netraid version encoding */
if ('A' <= sc->sc_fwver[2] && sc->sc_fwver[2] <= 'Z' &&
sc->sc_fwver[1] < ' ' && sc->sc_fwver[0] < ' ' &&