]> 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, 29 Nov 2012 03:18:14 +0000 (14:18 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 5 Dec 2012 05:23:24 +0000 (16:23 +1100)
commit442c90c5e2870f116ad6b6313e656581cfdb5bc0
treeca47e363618536e05eac8ee44285354f8e7bd4cb
parentfeb1d96a914905c57d6ae382920f876315d3ff06
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