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

Submitted by Olivia Yin on Nov. 29, 2012, 5:26 a.m.

Details

Message ID 1354166782-5146-5-git-send-email-hong-hua.yin@freescale.com
State New
Headers show

Commit Message

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 hide | download patch | download mbox

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;
     }
 }