OSDN Git Service

dma: Fix stupid typo/thinko
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 14 Aug 2012 07:41:47 +0000 (17:41 +1000)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 16 Aug 2012 18:41:16 +0000 (13:41 -0500)
Hi hard a brain fart when coding that function, it will
fail to "set" the memory beyond the first 512 bytes. This
is in turn causing guest crashes in ibmveth (spapr_llan.c
on the qemu side) due to the receive queue not being
properly initialized.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
dma-helpers.c

index 13593d1..433d8b2 100644 (file)
@@ -24,8 +24,8 @@ static void do_dma_memory_set(dma_addr_t addr, uint8_t c, dma_addr_t len)
     while (len > 0) {
         l = len < FILLBUF_SIZE ? len : FILLBUF_SIZE;
         cpu_physical_memory_rw(addr, fillbuf, l, true);
-        len -= len;
-        addr += len;
+        len -= l;
+        addr += l;
     }
 }