here is the diff I had for ami, the mfi one included here as a bonus
Index: ami.c
===================================================================
RCS file: /cvs/src/sys/dev/ic/ami.c,v
retrieving revision 1.223
diff -u -p -r1.223 ami.c
--- ami.c 9 Jan 2012 18:50:44 -0000 1.223
+++ ami.c 5 May 2013 01:06:08 -0000
@@ -496,12 +496,12 @@ 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' &&
Index: mfi.c
===================================================================
RCS file: /cvs/src/sys/dev/ic/mfi.c,v
retrieving revision 1.144
diff -u -p -r1.144 mfi.c
--- mfi.c 3 May 2013 02:46:28 -0000 1.144
+++ mfi.c 3 May 2013 07:20:03 -0000
@@ -1470,8 +1470,10 @@ mfi_bio_getitall(struct mfi_softc *sc)
if (cfg == NULL)
goto done;
if (mfi_mgmt(sc, MR_DCMD_CONF_GET, MFI_DATA_IN, sizeof *cfg, cfg,
- NULL))
+ NULL)) {
+ free(cfg, M_DEVBUF);
goto done;
+ }
size = cfg->mfc_size;
free(cfg, M_DEVBUF);