summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Hilman <khilman@mvista.com>2006-08-18 15:32:14 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-08-18 15:32:14 +0100
commite2785f0d4251c35d6e82ec819354374c8c17d63d (patch)
treea3d3f046c4ea1f0ee0fd13187ca71277fd70ff2b
parent332158e7c206dc6bee0dfb24f2c1d6096e0989cd (diff)
downloadop-kernel-dev-e2785f0d4251c35d6e82ec819354374c8c17d63d.zip
op-kernel-dev-e2785f0d4251c35d6e82ec819354374c8c17d63d.tar.gz
[ARM] 3755/1: dmabounce: fix return value for find_safe_buffer
Patch from Kevin Hilman Previous locking changes to dmabounce incorrectly return non-NULL even when buffer not found. Fix it up. Signed-off-by: Kevin Hilman <khilman@mvista.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/common/dmabounce.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 5b7c263..028bdc9 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -179,17 +179,19 @@ alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr,
static inline struct safe_buffer *
find_safe_buffer(struct dmabounce_device_info *device_info, dma_addr_t safe_dma_addr)
{
- struct safe_buffer *b = NULL;
+ struct safe_buffer *b, *rb = NULL;
unsigned long flags;
read_lock_irqsave(&device_info->lock, flags);
list_for_each_entry(b, &device_info->safe_buffers, node)
- if (b->safe_dma_addr == safe_dma_addr)
+ if (b->safe_dma_addr == safe_dma_addr) {
+ rb = b;
break;
+ }
read_unlock_irqrestore(&device_info->lock, flags);
- return b;
+ return rb;
}
static inline void
OpenPOWER on IntegriCloud