Patchwork [RFC,v6,4/4] free rom->data when rom_reset

login
register
mail settings
Submitter Olivia Yin
Date Nov. 27, 2012, 7:07 a.m.
Message ID <1354000059-805-5-git-send-email-hong-hua.yin@freescale.com>
Download mbox | patch
Permalink /patch/202109/
State New
Headers show

Comments

Olivia Yin - Nov. 27, 2012, 7:07 a.m.
Signed-off-by: Olivia Yin <hong-hua.yin@freescale.com>
---
 hw/loader.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

Patch

diff --git a/hw/loader.c b/hw/loader.c
index d075ed3..2dde6ba 100644
--- a/hw/loader.c
+++ b/hw/loader.c
@@ -752,11 +752,8 @@  static void rom_reset(void *unused)
             continue;
         }
         cpu_physical_memory_write_rom(rom->addr, rom->data, rom->romsize);
-        if (rom->isrom) {
-            /* rom needs to be written only once */
-            g_free(rom->data);
-            rom->data = NULL;
-        }
+        g_free(rom->data);
+        rom->data = NULL;
     }
 }