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

login
register
mail settings
Submitter Olivia Yin
Date Nov. 29, 2012, 5:26 a.m.
Message ID <1354166782-5146-5-git-send-email-hong-hua.yin@freescale.com>
Download mbox | patch
Permalink /patch/202663/
State New
Headers show

Comments

Olivia Yin - Nov. 29, 2012, 5:26 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 10e5726..c6f73bb 100644
--- a/hw/loader.c
+++ b/hw/loader.c
@@ -737,11 +737,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;
     }
 }