aboutsummaryrefslogtreecommitdiff
path: root/hw/onenand.c
diff options
context:
space:
mode:
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) {