diff options
Diffstat (limited to 'lib/genalloc.c')
-rw-r--r-- | lib/genalloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/genalloc.c b/lib/genalloc.c index dda31168844f..bdb9a456bcbb 100644 --- a/lib/genalloc.c +++ b/lib/genalloc.c | |||
@@ -316,7 +316,7 @@ EXPORT_SYMBOL(gen_pool_alloc); | |||
316 | * gen_pool_dma_alloc - allocate special memory from the pool for DMA usage | 316 | * gen_pool_dma_alloc - allocate special memory from the pool for DMA usage |
317 | * @pool: pool to allocate from | 317 | * @pool: pool to allocate from |
318 | * @size: number of bytes to allocate from the pool | 318 | * @size: number of bytes to allocate from the pool |
319 | * @dma: dma-view physical address | 319 | * @dma: dma-view physical address return value. Use NULL if unneeded. |
320 | * | 320 | * |
321 | * Allocate the requested number of bytes from the specified pool. | 321 | * Allocate the requested number of bytes from the specified pool. |
322 | * Uses the pool allocation function (with first-fit algorithm by default). | 322 | * Uses the pool allocation function (with first-fit algorithm by default). |
@@ -334,7 +334,8 @@ void *gen_pool_dma_alloc(struct gen_pool *pool, size_t size, dma_addr_t *dma) | |||
334 | if (!vaddr) | 334 | if (!vaddr) |
335 | return NULL; | 335 | return NULL; |
336 | 336 | ||
337 | *dma = gen_pool_virt_to_phys(pool, vaddr); | 337 | if (dma) |
338 | *dma = gen_pool_virt_to_phys(pool, vaddr); | ||
338 | 339 | ||
339 | return (void *)vaddr; | 340 | return (void *)vaddr; |
340 | } | 341 | } |