summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2006-01-14 17:22:47 +0000
committerscottl <scottl@FreeBSD.org>2006-01-14 17:22:47 +0000
commitec415604ac113037fe5565b05ca713ac76ee24eb (patch)
tree08f0b7d2919b668976fe776ee445a6c6d24e8cf7 /sys/amd64
parent33105fb85b141bdf4833ddf81ee6acd5ed0f700a (diff)
downloadFreeBSD-src-ec415604ac113037fe5565b05ca713ac76ee24eb.zip
FreeBSD-src-ec415604ac113037fe5565b05ca713ac76ee24eb.tar.gz
Free the newtag if we exit with a failure from alloc_bounce_zone().
Found by: Coverity Prevent(tm)
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/busdma_machdep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/amd64/amd64/busdma_machdep.c b/sys/amd64/amd64/busdma_machdep.c
index 199ab54..1d70417 100644
--- a/sys/amd64/amd64/busdma_machdep.c
+++ b/sys/amd64/amd64/busdma_machdep.c
@@ -285,8 +285,10 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
/* Must bounce */
- if ((error = alloc_bounce_zone(newtag)) != 0)
+ if ((error = alloc_bounce_zone(newtag)) != 0) {
+ free(newtag, M_DEVBUF);
return (error);
+ }
bz = newtag->bounce_zone;
if (ptoa(bz->total_bpages) < maxsize) {
OpenPOWER on IntegriCloud