diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-02-04 11:26:02 +0100 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2015-02-10 09:27:20 +0300 |
commit | 6b0126f94099db15fb0110218b17eeccefa077d1 (patch) | |
tree | e4b31f0b79f1154702f3a9ba5bb87a68fa69e5f9 /hw/block/onenand.c | |
parent | be7433efbf8b4134ab9763abdecaf2e6a35e1ed1 (diff) |
onenand: g_malloc() can't fail, bury dead error handling
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
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) { |