summary refs log tree commit diff stats
path: root/hw/onenand.c
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2012-10-06 18:54:14 +0200
committerAurelien Jarno <aurelien@aurel32.net>2012-10-06 18:54:14 +0200
commit048d3612a51b3da45081091b734f93428925ebf8 (patch)
treead2b1235146f9bc5b94c1bfae02327ee3b03fa40 /hw/onenand.c
parent6b2f90fbbd31d594238098f46ef63ee307a12f55 (diff)
parent02cd521f6e207bd8843a7c1309f6d065cf01c6ee (diff)
downloadfocaccia-qemu-048d3612a51b3da45081091b734f93428925ebf8.tar.gz
focaccia-qemu-048d3612a51b3da45081091b734f93428925ebf8.zip
Merge branch 'trivial-patches' of git://github.com/stefanha/qemu
* 'trivial-patches' of git://github.com/stefanha/qemu:
  versatilepb: Use symbolic indices for ARM PIC
  qdev: kill bogus comment
  qemu-barrier: Fix compiler version check for future gcc versions
  hw: Add missing 'static' attribute for QEMUMachine
  cleanup useless return sentence
  qemu-sockets: Fix compiler warning (regression for MinGW)
  vnc: Fix spelling (hellmen -> hellman) in comment
  slirp: Fix spelling in comment (enought -> enough, insure -> ensure)
  tcg/arm: Use tcg_out_mov_reg rather than inline equivalent code
  cpu: Add missing 'static' attribute to qemu_global_mutex
  configure: Support empty target list (--target-list=)
  hw: Fix return value check for bdrv_read, bdrv_write
Diffstat (limited to 'hw/onenand.c')
-rw-r--r--hw/onenand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/onenand.c b/hw/onenand.c
index db6af682c4..0f7b755a6d 100644
--- a/hw/onenand.c
+++ b/hw/onenand.c
@@ -351,7 +351,7 @@ static inline int onenand_erase(OneNANDState *s, int sec, int num)
     for (; num > 0; num--, sec++) {
         if (s->bdrv_cur) {
             int erasesec = s->secs_cur + (sec >> 5);
-            if (bdrv_write(s->bdrv_cur, sec, blankbuf, 1)) {
+            if (bdrv_write(s->bdrv_cur, sec, blankbuf, 1) < 0) {
                 goto fail;
             }
             if (bdrv_read(s->bdrv_cur, erasesec, tmpbuf, 1) < 0) {