]> 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, 20 Mar 2013 04:07:30 +0000 (15:07 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Mar 2013 05:33:55 +0000 (16:33 +1100)
commit7aca1c8e4fa5de0e41306b2c1b11324d30ecf152
tree91cb5e096bf16ea643d064f341da2128b94a062c
parentfcadce093bc99a02b3c9f5d7dd0dffd9a5f22621
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