diff options
-rw-r--r-- | drivers/firewire/ohci.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index b5ba66656c6c..84eb607d6c03 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -740,11 +740,13 @@ static void ar_context_tasklet(unsigned long data) | |||
740 | struct ar_buffer *ab; | 740 | struct ar_buffer *ab; |
741 | struct descriptor *d; | 741 | struct descriptor *d; |
742 | void *buffer, *end; | 742 | void *buffer, *end; |
743 | __le16 res_count; | ||
743 | 744 | ||
744 | ab = ctx->current_buffer; | 745 | ab = ctx->current_buffer; |
745 | d = &ab->descriptor; | 746 | d = &ab->descriptor; |
746 | 747 | ||
747 | if (d->res_count == 0) { | 748 | res_count = ACCESS_ONCE(d->res_count); |
749 | if (res_count == 0) { | ||
748 | size_t size, size2, rest, pktsize, size3, offset; | 750 | size_t size, size2, rest, pktsize, size3, offset; |
749 | dma_addr_t start_bus; | 751 | dma_addr_t start_bus; |
750 | void *start; | 752 | void *start; |
@@ -812,7 +814,7 @@ static void ar_context_tasklet(unsigned long data) | |||
812 | } else { | 814 | } else { |
813 | buffer = ctx->pointer; | 815 | buffer = ctx->pointer; |
814 | ctx->pointer = end = | 816 | ctx->pointer = end = |
815 | (void *) ab + PAGE_SIZE - le16_to_cpu(d->res_count); | 817 | (void *) ab + PAGE_SIZE - le16_to_cpu(res_count); |
816 | 818 | ||
817 | while (buffer < end) | 819 | while (buffer < end) |
818 | buffer = handle_ar_packet(ctx, buffer); | 820 | buffer = handle_ar_packet(ctx, buffer); |