diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-11-09 14:30:44 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-11-09 14:30:44 +0000 |
commit | bf2b4eccef4fa08824ea178bf30d6734a6a62ccb (patch) | |
tree | 0feda343a5a548c72e4d3f991d301e2fbd2702a0 /sys/arch | |
parent | bdfe5bfc6ba6f84c4341a8e40d118f03e2f66e5b (diff) |
Always free memory on failure in c{e,s}4231_alloc(); from Patrick Lafiti.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc64/dev/ce4231.c | 5 |
1 files changed, 3 insertions, 2 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); } |