Subject: [-] mm-dmapoolc-fix-null-dev-in-dma_pool_create.patch removed from -mm tree To: xi.wang@xxxxxxxxx,rientjes@xxxxxxxxxx,mm-commits@xxxxxxxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Wed, 10 Jul 2013 13:25:07 -0700 The patch titled Subject: mm/dmapool.c: fix null dev in dma_pool_create() has been removed from the -mm tree. Its filename was mm-dmapoolc-fix-null-dev-in-dma_pool_create.patch This patch was dropped because it has gone stale ------------------------------------------------------ From: Xi Wang <xi.wang@xxxxxxxxx> Subject: 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@xxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/dmapool.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff -puN mm/dmapool.c~mm-dmapoolc-fix-null-dev-in-dma_pool_create mm/dmapool.c --- a/mm/dmapool.c~mm-dmapoolc-fix-null-dev-in-dma_pool_create +++ a/mm/dmapool.c @@ -132,6 +132,7 @@ struct dma_pool *dma_pool_create(const c { struct dma_pool *retval; size_t allocation; + int node; if (align == 0) { align = 1; @@ -156,7 +157,9 @@ struct dma_pool *dma_pool_create(const c return NULL; } - retval = kmalloc_node(sizeof(*retval), GFP_KERNEL, dev_to_node(dev)); + node = WARN_ON(!dev) ? -1 : dev_to_node(dev); + + retval = kmalloc_node(sizeof(*retval), GFP_KERNEL, node); if (!retval) return retval; _ Patches currently in -mm which might be from xi.wang@xxxxxxxxx are -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html