]> git.baikalelectronics.ru Git - kernel.git/commit
mm: add a might_sleep_if() to dma_pool_alloc()
authorDima Zavin <dima@android.com>
Tue, 26 Oct 2010 21:21:54 +0000 (14:21 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Oct 2010 23:52:08 +0000 (16:52 -0700)
commitfb097037bb55f5b57a3f91c853acc465ef3c8749
treee1ebb0406f156e406b3bef5998084b688794923e
parente279f8ba6bf572b2e94f71b02bd85bae805a0c3a
mm: add a might_sleep_if() to dma_pool_alloc()

Buggy drivers (e.g.  fsl_udc) could call dma_pool_alloc from atomic
context with GFP_KERNEL.  In most instances, the first pool_alloc_page
call would succeed and the sleeping functions would never be called.  This
allowed the buggy drivers to slip through the cracks.

Add a might_sleep_if() checking for __GFP_WAIT in flags.

Signed-off-by: Dima Zavin <dima@android.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/dmapool.c