From: Xi Wang Date: Thu, 9 May 2013 23:57:19 +0000 (+1000) Subject: drivers/usb/gadget/amd5536udc.c: avoid calling dma_pool_create() with NULL dev X-Git-Tag: next-20130521~1^2~133 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2f6ddd90991a67b70e84c9ab593964ca46c3184d;p=karo-tx-linux.git 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 --- 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");