summaryrefslogtreecommitdiffstats
path: root/sys/dev/aac
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2005-03-19 06:29:32 +0000
committerscottl <scottl@FreeBSD.org>2005-03-19 06:29:32 +0000
commitd2396e762ac90e0d08f86e4bbd8dae976ce5320a (patch)
treef1417a934c1cc5a6bc94debfb4f65c58aaa62fc8 /sys/dev/aac
parentefb9d71d393fb63a0aa0b5a85bdea8bf6f3690d3 (diff)
downloadFreeBSD-src-d2396e762ac90e0d08f86e4bbd8dae976ce5320a.zip
FreeBSD-src-d2396e762ac90e0d08f86e4bbd8dae976ce5320a.tar.gz
Handle failures better in the passthrough bus creation code.
Submitted by: Coverity Prevent analysis tool
Diffstat (limited to 'sys/dev/aac')
-rw-r--r--sys/dev/aac/aac.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index 35b5d64..79ca57d 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -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;
OpenPOWER on IntegriCloud