summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-01 20:46:14 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-01 20:46:14 +0200
commit670e23ceb1aefacfe9aeccfc871e28e9cf973286 (patch)
tree4776bfd34fd74754dc30fe50574f8fb0e2bdb5fe /drivers
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.25 (diff)
parentfirewire: fw-ohci: plug dma memory leak in AR handler (diff)
downloadlinux-670e23ceb1aefacfe9aeccfc871e28e9cf973286.tar.xz
linux-670e23ceb1aefacfe9aeccfc871e28e9cf973286.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: firewire: fw-ohci: plug dma memory leak in AR handler
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/fw-ohci.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 996d61f0d460..ca6d51efd8bb 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -401,7 +401,8 @@ static void ar_context_tasklet(unsigned long data)
if (d->res_count == 0) {
size_t size, rest, offset;
- dma_addr_t buffer_bus;
+ dma_addr_t start_bus;
+ void *start;
/*
* This descriptor is finished and we may have a
@@ -410,9 +411,9 @@ static void ar_context_tasklet(unsigned long data)
*/
offset = offsetof(struct ar_buffer, data);
- buffer_bus = le32_to_cpu(ab->descriptor.data_address) - offset;
+ start = buffer = ab;
+ start_bus = le32_to_cpu(ab->descriptor.data_address) - offset;
- buffer = ab;
ab = ab->next;
d = &ab->descriptor;
size = buffer + PAGE_SIZE - ctx->pointer;
@@ -427,7 +428,7 @@ static void ar_context_tasklet(unsigned long data)
buffer = handle_ar_packet(ctx, buffer);
dma_free_coherent(ohci->card.device, PAGE_SIZE,
- buffer, buffer_bus);
+ start, start_bus);
ar_context_add_page(ctx);
} else {
buffer = ctx->pointer;