[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 31/46] onenand: g_malloc() can't fail, bury dead erro
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 31/46] onenand: g_malloc() can't fail, bury dead error handling |
Date: |
Tue, 10 Feb 2015 09:34:20 +0300 |
From: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Gonglei <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
hw/block/onenand.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/hw/block/onenand.c b/hw/block/onenand.c
index 348630d..1b2c893 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) {
--
2.1.4
- Re: [Qemu-devel] [PULL 00/46] Trivial patches for 2015-02-10, (continued)
- [Qemu-devel] [PULL 24/46] spapr_vio: Pair g_malloc() with g_free(), not free(), Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 03/46] Add tracing to xenfb., Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 32/46] rtl8139: g_malloc() can't fail, bury dead error handling, Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 28/46] util/uri: URI member path can be null, compare more carfully, Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 19/46] qemu-sockets: Fix buffer overflow in inet_parse(), Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 30/46] Fix name error in migration stream analyzation script, Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 13/46] qemu-log: Correct help text of 'log cpu_reset', Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 21/46] libcacard: stop linking against every single 3rd party library, Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 39/46] migration: Fix warning caused by missing declaration of vmstate_dummy, Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 31/46] onenand: g_malloc() can't fail, bury dead error handling,
Michael Tokarev <=
- [Qemu-devel] [PULL 27/46] util/uri: realloc2n() can't fail, drop dead error handling, Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 14/46] cpu-exec: drop dead assignment, Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 46/46] virtio: Fix warning caused by missing 'static' attribute, Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 40/46] migration: Fix warnings caused by missing 'static' attribute, Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 05/46] Add/convert trace calls in pcnet-pci.c., Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 23/46] qemu-option: Pair g_malloc() with g_free(), not free(), Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 33/46] kvm: g_malloc() can't fail, bury dead error handling, Michael Tokarev, 2015/02/10
- [Qemu-devel] [PULL 20/46] linux-user: wrong TARGET_SI_PAD_SIZE value for some targets., Michael Tokarev, 2015/02/10