]> 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>
Tue, 26 Mar 2013 23:24:48 +0000 (10:24 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 2 Apr 2013 07:29:14 +0000 (18:29 +1100)
commitbeb707415b288fecaa6d0a1a0ca2e456a475a1b5
tree354800fb6b6f0ef0a323293177f6bc6ca978775a
parenteb103b2fb60c2e35f4dd424eab408cfc52883eb4
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