From 6d3f1da0c6f85f4d88c3fe24edfa6a6f7cdad0eb Mon Sep 17 00:00:00 2001 From: Xi Wang Date: Thu, 23 May 2013 10:37:22 +1000 Subject: [PATCH] drivers/usb/gadget/amd5536udc.c: avoid calling dma_pool_create() with NULL dev Calling dma_pool_create() with dev==NULL will oops on a NUMA machine. Rather than changing dma_pool_create() we wish to disallow passing dev==NULL. This requires fixing up the small number of drivers which are passing in dev==NULL. Use &dev->pdev->dev instead of NULL. Signed-off-by: Xi Wang Cc: Felipe Balbi Cc: Greg KH Signed-off-by: Andrew Morton --- drivers/usb/gadget/amd5536udc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c index f52dcfe8f545..24bd363ca351 100644 --- a/drivers/usb/gadget/amd5536udc.c +++ b/drivers/usb/gadget/amd5536udc.c @@ -3099,7 +3099,7 @@ static int init_dma_pools(struct udc *dev) } /* DMA setup */ - dev->data_requests = dma_pool_create("data_requests", NULL, + dev->data_requests = dma_pool_create("data_requests", &dev->pdev->dev, sizeof(struct udc_data_dma), 0, 0); if (!dev->data_requests) { DBG(dev, "can't get request data pool\n"); @@ -3111,7 +3111,7 @@ static int init_dma_pools(struct udc *dev) dev->ep[UDC_EP0IN_IX].dma = &dev->regs->ctl; /* dma desc for setup data */ - dev->stp_requests = dma_pool_create("setup requests", NULL, + dev->stp_requests = dma_pool_create("setup requests", &dev->pdev->dev, sizeof(struct udc_stp_dma), 0, 0); if (!dev->stp_requests) { DBG(dev, "can't get stp request pool\n"); -- 2.39.5