svn commit: r235040 - head/sys/dev/mfi
Doug Ambrisko
ambrisko at FreeBSD.org
Fri May 4 22:54:55 UTC 2012
Author: ambrisko
Date: Fri May 4 22:54:54 2012
New Revision: 235040
URL: http://svn.freebsd.org/changeset/base/235040
Log:
Fix the returns in mfi_tbolt_sync_map_info. I forgot to change
them to cleanup and goto out when acknowledging the LD's. Check
for failure on malloc. Remove a couple of extra lines and remove
the spurious return.
Prompted by: Petr Lampa
MFC after: 3 days
Modified:
head/sys/dev/mfi/mfi_tbolt.c
Modified: head/sys/dev/mfi/mfi_tbolt.c
==============================================================================
--- head/sys/dev/mfi/mfi_tbolt.c Fri May 4 22:48:44 2012 (r235039)
+++ head/sys/dev/mfi/mfi_tbolt.c Fri May 4 22:54:54 2012 (r235040)
@@ -1290,7 +1290,6 @@ mfi_process_fw_state_chg_isr(void *arg)
mtx_unlock(&sc->mfi_io_lock);
}
-
/*
* The ThunderBolt HW has an option for the driver to directly
* access the underlying disks and operate on the RAID. To
@@ -1362,13 +1361,21 @@ mfi_tbolt_sync_map_info(struct mfi_softc
mtx_unlock(&sc->mfi_io_lock);
ld_sync = (union mfi_ld_ref *) malloc(ld_size, M_MFIBUF,
M_WAITOK | M_ZERO);
+ if (ld_sync == NULL) {
+ device_printf(sc->mfi_dev, "Failed to allocate sync\n");
+ goto out;
+ }
for (i = 0; i < list->ld_count; i++) {
ld_sync[i].ref = list->ld_list[i].ld.ref;
}
mtx_lock(&sc->mfi_io_lock);
- if ((cmd = mfi_dequeue_free(sc)) == NULL)
- return;
+ if ((cmd = mfi_dequeue_free(sc)) == NULL) {
+ device_printf(sc->mfi_dev, "Failed to get command\n");
+ free(ld_sync, M_MFIBUF);
+ goto out;
+ }
+
context = cmd->cm_frame->header.context;
bzero(cmd->cm_frame, sizeof(union mfi_frame));
cmd->cm_frame->header.context = context;
@@ -1396,7 +1403,10 @@ mfi_tbolt_sync_map_info(struct mfi_softc
if ((error = mfi_mapcmd(sc, cmd)) != 0) {
device_printf(sc->mfi_dev, "failed to send map sync\n");
- return;
+ free(ld_sync, M_MFIBUF);
+ sc->mfi_map_sync_cm = NULL;
+ mfi_requeue_ready(cmd);
+ goto out;
}
out:
@@ -1405,11 +1415,8 @@ out:
if (cm)
mfi_release_command(cm);
mtx_unlock(&sc->mfi_io_lock);
-
- return;
}
-
static void
mfi_sync_map_complete(struct mfi_command *cm)
{
More information about the svn-src-all
mailing list