diff options
Diffstat (limited to 'hw/block/onenand.c')
-rw-r--r-- | hw/block/onenand.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/hw/block/onenand.c b/hw/block/onenand.c index 348630d905..1b2c893756 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -346,15 +346,9 @@ static inline int onenand_prog_spare(OneNANDState *s, int sec, int secn, static inline int onenand_erase(OneNANDState *s, int sec, int num) { uint8_t *blankbuf, *tmpbuf; + blankbuf = g_malloc(512); - if (!blankbuf) { - return 1; - } tmpbuf = g_malloc(512); - if (!tmpbuf) { - g_free(blankbuf); - return 1; - } memset(blankbuf, 0xff, 512); for (; num > 0; num--, sec++) { if (s->blk_cur) { |