Files
linux-legacy/kernel
Andrew Morton 0bef3c2dc7 dma_alloc_from_coherent(): fix fallback to generic memory
If bitmap_find_free_region() fails and DMA_MEMORY_EXCLUSIVE is not set,
the function will fail to write anything to *ret and will return 1.             This will cause dma_alloc_coherent() to return an uninitialised value,
crashing the kernel, perhaps via DMA to a random address.

Fix that by changing it to return zero in this case, so the caller will
proceed to allocate the memory from the generic memory allocator.

Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:30 -08:00
..
…
2009-01-04 15:14:41 -05:00
2009-01-06 15:59:01 -08:00
…
2008-11-24 18:57:41 -05:00
…
…
…
…
…
2009-01-06 15:59:27 -08:00
…
2008-12-10 08:01:54 -08:00
2009-01-06 15:59:21 -08:00
…
…
…
…
…
…
…
…
2008-11-19 18:49:57 -08:00
2008-12-31 15:11:46 +01:00
…
…