X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=blobdiff_plain;f=arch%2Fsandbox%2Fcpu%2Fstate.c;h=59adad653c2a9f59741ec0276363ea73eee2a3b2;hp=a145808a52d43c350b7b568d9678fe102bf4d662;hb=ab839dc3e6c1d07bc926199f3eebace0804f2ecf;hpb=ffb87905cb3883c84598b87ca05384c17d59dee1 diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index a145808a52..59adad653c 100644 --- a/arch/sandbox/cpu/state.c +++ b/arch/sandbox/cpu/state.c @@ -365,7 +365,7 @@ int state_uninit(void) state = &main_state; - if (state->write_ram_buf) { + if (state->write_ram_buf && !state->ram_buf_rm) { err = os_write_ram_buf(state->ram_buf_fname); if (err) { printf("Failed to write RAM buffer\n"); @@ -380,6 +380,10 @@ int state_uninit(void) } } + /* Delete this at the last moment so as not to upset gdb too much */ + if (state->jumped_fname) + os_unlink(state->jumped_fname); + if (state->state_fdt) os_free(state->state_fdt); memset(state, '\0', sizeof(*state));