From: Dmitry Baryshkov Date: Fri, 18 Jul 2008 09:29:57 +0000 (+0400) Subject: Generic dma-coherent: fix DMA_MEMORY_EXCLUSIVE X-Git-Tag: v2.6.27-rc1~3^2~1^2~5 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=538c29d43ebdac2edcef96ac07982d2296a63077;p=linux-2.6-omap-h63xx.git Generic dma-coherent: fix DMA_MEMORY_EXCLUSIVE Don't rewrite successfull allocation return values in case the memory was marked with DMA_MEMORY_EXCLUSIVE. Signed-off-by: Dmitry Baryshkov Cc: Jesse Barnes Signed-off-by: Ingo Molnar --- diff --git a/kernel/dma-coherent.c b/kernel/dma-coherent.c index 89a554cfd93..56dff5cb0f2 100644 --- a/kernel/dma-coherent.c +++ b/kernel/dma-coherent.c @@ -105,8 +105,7 @@ int dma_alloc_from_coherent(struct device *dev, ssize_t size, *dma_handle = mem->device_base + (page << PAGE_SHIFT); *ret = mem->virt_base + (page << PAGE_SHIFT); memset(*ret, 0, size); - } - if (mem->flags & DMA_MEMORY_EXCLUSIVE) + } else if (mem->flags & DMA_MEMORY_EXCLUSIVE) *ret = NULL; } return (mem != NULL);