]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
mm/dmapool.c: fix null dev in dma_pool_create()
authorXi Wang <xi.wang@gmail.com>
Wed, 3 Jul 2013 00:20:20 +0000 (10:20 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 17 Jul 2013 02:34:59 +0000 (12:34 +1000)
commit3dc65584b3e1310a221b78750586f74eaa47c846
tree2fd46412f60200e4d922beba05dc0c7636459099
parent7eb7f3a4e610bfc53c6f3925687451f17454819b
mm/dmapool.c: fix null dev in dma_pool_create()

A few drivers invoke dma_pool_create() with a null dev.  Note that dev is
dereferenced in dev_to_node(dev), causing a null pointer dereference.

A long term solution is to disallow null dev.  Once the drivers are fixed,
we can simplify the core code here.  For now we add WARN_ON(!dev) to
notify the driver maintainers and avoid the null pointer dereference.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/dmapool.c