]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/usb/gadget/amd5536udc.c: avoid calling dma_pool_create() with NULL dev
authorXi Wang <xi.wang@gmail.com>
Thu, 9 May 2013 23:57:19 +0000 (09:57 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 21 May 2013 04:17:42 +0000 (14:17 +1000)
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 <xi.wang@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/usb/gadget/amd5536udc.c

index f52dcfe8f545077df80aca9cb97f1ec2e72b6261..24bd363ca351870b07049c4a5b90b04c59563a56 100644 (file)
@@ -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");