diff options
| author | David S. Miller <davem@davemloft.net> | 2010-04-21 01:14:25 -0700 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-04-21 01:14:25 -0700 |
| commit | 87eb367003887cdc81a5d183efea227b5b488961 (patch) | |
| tree | 40f617e25a9364d573e3cd2189c9e7fa56c8a0fe /arch/arm/mach-bcmring/dma.c | |
| parent | ccb7c7732e2ceb4e81a7806faf1670be9681ccd2 (diff) | |
| parent | 05d17608a69b3ae653ea5c9857283bef3439c733 (diff) | |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/iwlwifi/iwl-6000.c
net/core/dev.c
Diffstat (limited to 'arch/arm/mach-bcmring/dma.c')
| -rw-r--r-- | arch/arm/mach-bcmring/dma.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/arm/mach-bcmring/dma.c b/arch/arm/mach-bcmring/dma.c index 2ccf670ce1a..29c0a911df2 100644 --- a/arch/arm/mach-bcmring/dma.c +++ b/arch/arm/mach-bcmring/dma.c @@ -2221,11 +2221,15 @@ EXPORT_SYMBOL(dma_map_create_descriptor_ring); int dma_unmap(DMA_MemMap_t *memMap, /* Stores state information about the map */ int dirtied /* non-zero if any of the pages were modified */ ) { + + int rc = 0; int regionIdx; int segmentIdx; DMA_Region_t *region; DMA_Segment_t *segment; + down(&memMap->lock); + for (regionIdx = 0; regionIdx < memMap->numRegionsUsed; regionIdx++) { region = &memMap->region[regionIdx]; @@ -2239,7 +2243,8 @@ int dma_unmap(DMA_MemMap_t *memMap, /* Stores state information about the map */ printk(KERN_ERR "%s: vmalloc'd pages are not yet supported\n", __func__); - return -EINVAL; + rc = -EINVAL; + goto out; } case DMA_MEM_TYPE_KMALLOC: @@ -2276,7 +2281,8 @@ int dma_unmap(DMA_MemMap_t *memMap, /* Stores state information about the map */ printk(KERN_ERR "%s: Unsupported memory type: %d\n", __func__, region->memType); - return -EINVAL; + rc = -EINVAL; + goto out; } } @@ -2314,9 +2320,10 @@ int dma_unmap(DMA_MemMap_t *memMap, /* Stores state information about the map */ memMap->numRegionsUsed = 0; memMap->inUse = 0; +out: up(&memMap->lock); - return 0; + return rc; } EXPORT_SYMBOL(dma_unmap); |
