Skip to content

Commit

Permalink
ARC: Don't memzero twice in dma_alloc_coherent for __GFP_ZERO
Browse files Browse the repository at this point in the history
alloc_pages_exact() get gfp flags and handle zero'ing already

And while it, fix the case where ioremap fails: return rightaway.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
  • Loading branch information
Vineet Gupta committed Jul 6, 2015
1 parent 9770906 commit f718c2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arc/mm/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ void *dma_alloc_coherent(struct device *dev, size_t size,

/* This is kernel Virtual address (0x7000_0000 based) */
kvaddr = ioremap_nocache((unsigned long)paddr, size);
if (kvaddr != NULL)
memset(kvaddr, 0, size);
if (kvaddr == NULL)
return NULL;

/* This is bus address, platform dependent */
*dma_handle = (dma_addr_t)paddr;
Expand Down

0 comments on commit f718c2e

Please sign in to comment.