From 1d50dd1f08040e49ae749fbde13c04fdbea7bcc1 Mon Sep 17 00:00:00 2001 From: Christian Brueffer Date: Wed, 18 Jul 2012 09:06:07 +0000 Subject: [PATCH] Fix a small memory leak in mpssas_get_sata_identify(). The change has been submitted upstream as well. Reviewed by: ken, scottl Obtained from: DragonFly BSD (change df8658e030226dd015cff9749452666d8fe1e87b) MFC after: 5 days --- sys/dev/mps/mps_sas_lsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/mps/mps_sas_lsi.c b/sys/dev/mps/mps_sas_lsi.c index 9cedcd3d938c..476319222ab4 100644 --- a/sys/dev/mps/mps_sas_lsi.c +++ b/sys/dev/mps/mps_sas_lsi.c @@ -796,8 +796,10 @@ mpssas_get_sata_identify(struct mps_softc *sc, u16 handle, if (!buffer) return ENOMEM; - if ((cm = mps_alloc_command(sc)) == NULL) + if ((cm = mps_alloc_command(sc)) == NULL) { + free(buffer, M_MPT2); return (EBUSY); + } mpi_request = (MPI2_SATA_PASSTHROUGH_REQUEST *)cm->cm_req; bzero(mpi_request,sizeof(MPI2_SATA_PASSTHROUGH_REQUEST)); mpi_request->Function = MPI2_FUNCTION_SATA_PASSTHROUGH;