The s->addr should be reset along with the s->addrlen,
or it might have the previous address shifted to MSB
and then causes problem to nand erase operation.

Signed-off-by: Kuo-Jung Su <dant...@gmail.com>
---
 hw/nand.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/nand.c b/hw/nand.c
index 61e918f..6b2f2b8 100644
--- a/hw/nand.c
+++ b/hw/nand.c
@@ -511,6 +511,7 @@ void nand_setio(DeviceState *dev, uint32_t value)
             nand_command(s);
 
         if (s->cmd != NAND_CMD_RANDOMREAD2) {
+            s->addr = 0;
             s->addrlen = 0;
         }
     }
-- 
1.7.9.5


Reply via email to