]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm/dmapool.c: fix null dev in dma_pool_create()
authorXi Wang <xi.wang@gmail.com>
Thu, 7 Feb 2013 01:27:13 +0000 (12:27 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:46:55 +0000 (16:46 +1100)
commitc2107008479b40898680da8b65b26939752d317f
treead0378efc980c3e7f5c073a26ab6177d8e459155
parent7044b03eb24d5f62ccba9b31fa5a8df6b60af489
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