summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/dev/ce4231.c5
-rw-r--r--sys/dev/sbus/cs4231.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/sparc64/dev/ce4231.c b/sys/arch/sparc64/dev/ce4231.c
index b222bad1392..496ad60b954 100644
--- a/sys/arch/sparc64/dev/ce4231.c
+++ b/sys/arch/sparc64/dev/ce4231.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ce4231.c,v 1.16 2004/09/29 19:17:43 miod Exp $ */
+/* $OpenBSD: ce4231.c,v 1.17 2004/11/09 14:30:34 miod Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -1404,7 +1404,7 @@ ce4231_alloc(addr, direction, size, pool, flags)
p = (struct cs_dma *)malloc(sizeof(struct cs_dma), pool, flags);
if (p == NULL)
- goto fail;
+ return (NULL);
if (bus_dmamap_create(dmat, size, 1, size, 0,
BUS_DMA_NOWAIT, &p->dmamap) != 0)
@@ -1436,6 +1436,7 @@ fail2:
fail1:
bus_dmamap_destroy(dmat, p->dmamap);
fail:
+ free(p, pool);
return (NULL);
}
diff --git a/sys/dev/sbus/cs4231.c b/sys/dev/sbus/cs4231.c
index 6b4e9177256..05e9738500d 100644
--- a/sys/dev/sbus/cs4231.c
+++ b/sys/dev/sbus/cs4231.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cs4231.c,v 1.22 2004/09/29 19:17:43 miod Exp $ */
+/* $OpenBSD: cs4231.c,v 1.23 2004/11/09 14:30:43 miod Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -1434,7 +1434,7 @@ cs4231_alloc(void *vsc, int direction, size_t size, int pool, int flags)
p = (struct cs_dma *)malloc(sizeof(struct cs_dma), pool, flags);
if (p == NULL)
- goto fail;
+ return (NULL);
if (bus_dmamap_create(dmat, size, 1, size, 0,
BUS_DMA_NOWAIT, &p->dmamap) != 0)
@@ -1466,6 +1466,7 @@ fail2:
fail1:
bus_dmamap_destroy(dmat, p->dmamap);
fail:
+ free(p, pool);
return (NULL);
}