Skip to content

Commit

Permalink
ixp4xx_hss: avoid calling dma_pool_create() with NULL dev
Browse files Browse the repository at this point in the history
Use &port->netdev->dev instead of NULL since dma_pool_create() doesn't
allow NULL dev.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Xi Wang authored and David S. Miller committed Nov 20, 2012
1 parent 1a49011 commit 3e2f61c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/wan/ixp4xx_hss.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,10 +969,12 @@ static int init_hdlc_queues(struct port *port)
{
int i;

if (!ports_open)
if (!(dma_pool = dma_pool_create(DRV_NAME, NULL,
POOL_ALLOC_SIZE, 32, 0)))
if (!ports_open) {
dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev,
POOL_ALLOC_SIZE, 32, 0);
if (!dma_pool)
return -ENOMEM;
}

if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
&port->desc_tab_phys)))
Expand Down

0 comments on commit 3e2f61c

Please sign in to comment.