diff options
author | Fathi Boudra <fathi.boudra@linaro.org> | 2012-09-15 09:43:51 +0300 |
---|---|---|
committer | Fathi Boudra <fathi.boudra@linaro.org> | 2012-12-25 16:58:47 +0200 |
commit | f77d2c3c841d1990d10ab147b770bf5673dbfacc (patch) | |
tree | 24ad479e52a07b73625a5fe6d9d350b2c97be0db /dma-helpers.c | |
parent | 111465fea3aa2452c34a609bdc4318d9a7667bb7 (diff) | |
parent | dd55a01d2af35f5e9dabb2b745770afd008c9e24 (diff) |
Imported Debian patch 1.2.0-2012.09-0ubuntu1~linaro1debian/1.2.0-2012.09-0ubuntu1_linaro1
Diffstat (limited to 'dma-helpers.c')
-rw-r--r-- | dma-helpers.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dma-helpers.c b/dma-helpers.c index 35cb500..433d8b2 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -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; } } @@ -65,6 +65,7 @@ void qemu_sglist_add(QEMUSGList *qsg, dma_addr_t base, dma_addr_t len) void qemu_sglist_destroy(QEMUSGList *qsg) { g_free(qsg->sg); + memset(qsg, 0, sizeof(*qsg)); } typedef struct { |