summaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/mmu.h
diff options
context:
space:
mode:
authorKrzysztof Halasa <khc@pm.waw.pl>2011-01-06 16:23:01 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2011-01-07 10:21:22 +0100
commitc5baa0edc4a70c2f44cb7422e2b47ab5c96570ed (patch)
treed45c280198754e96276f6a633a206233504790b3 /arch/arm/include/asm/mmu.h
parentc99d28ca568a6e0d713c42bfbb9cd5310588d857 (diff)
downloadbarebox-c5baa0edc4a70c2f44cb7422e2b47ab5c96570ed.tar.gz
barebox-c5baa0edc4a70c2f44cb7422e2b47ab5c96570ed.tar.xz
Fix error handling with malloc, memalign etc. Introduce xmemalign().
The idea is to panic() when there is no memory available for normal operation. Exception: code which can consume arbitrary amount of RAM (example: files allocated in ramfs) must report error instead of panic(). This patch also fixes code which didn't check for NULL from malloc() etc. Usage: malloc(), memalign() return NULL when out of RAM. xmalloc(), xmemalign() always return non-NULL or panic(). Signed-off-by: Krzysztof HaƂasa <khc@pm.waw.pl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/include/asm/mmu.h')
-rw-r--r--arch/arm/include/asm/mmu.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
index fdd23b5549..7789cc9b23 100644
--- a/arch/arm/include/asm/mmu.h
+++ b/arch/arm/include/asm/mmu.h
@@ -28,7 +28,7 @@ void *phys_to_virt(unsigned long phys);
#else
static inline void *dma_alloc_coherent(size_t size)
{
- return malloc(size);
+ return xmalloc(size);
}
static inline void dma_free_coherent(void *mem)