1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Handle failures better in the passthrough bus creation code.

Submitted by: Coverity Prevent analysis tool
This commit is contained in:
Scott Long 2005-03-19 06:29:32 +00:00
parent b53d6ac575
commit b5f516cdaf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=143838

View File

@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
#include <machine/bus_memio.h>
#include <machine/bus.h>
#include <sys/bus_dma.h>
#include <machine/resource.h>
#include <dev/aac/aacreg.h>
@ -3019,13 +3020,19 @@ aac_get_bus_info(struct aac_softc *sc)
caminf = (struct aac_sim *)malloc( sizeof(struct aac_sim),
M_AACBUF, M_NOWAIT | M_ZERO);
if (caminf == NULL)
continue;
if (caminf == NULL) {
device_printf(sc->aac_dev,
"No memory to add passthrough bus %d\n", i);
break;
}
child = device_add_child(sc->aac_dev, "aacp", -1);
if (child == NULL) {
device_printf(sc->aac_dev, "device_add_child failed\n");
continue;
device_printf(sc->aac_dev,
"device_add_child failed for passthrough bus %d\n",
i);
free(caminf, M_AACBUF);
break;
}
caminf->TargetsPerBus = businfo.TargetsPerBus;