diff options
author | Simon Glass | 2021-02-06 09:57:33 -0700 |
---|---|---|
committer | Tom Rini | 2021-03-02 15:53:37 -0500 |
commit | b308d9fd18fa4b9beed880a6ad169e7ab003a62f (patch) | |
tree | eb63fd70c1892db02313948293e11cb011c50e85 /include | |
parent | 14e46dfb176b4505e4bafa545d3facb9228d40a9 (diff) |
sandbox: Avoid using malloc() for system state
This state is not accessible to the running U-Boot but at present it is
allocated in the emulated SDRAM. This doesn't seem very useful. Adjust
it to allocate from the OS instead.
The RAM buffer is currently not freed, but should be, so add that into
state_uninit(). Update the comment for os_free() to indicate that NULL is
a valid parameter value.
Note that the strdup() in spl_board_load_image() is changed as well, since
strdup() allocates memory in the RAM buffer.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/os.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/os.h b/include/os.h index fd010cfee83..d2a4afeca0f 100644 --- a/include/os.h +++ b/include/os.h @@ -123,7 +123,8 @@ void *os_malloc(size_t length); * * This returns the memory to the OS. * - * @ptr: Pointer to memory block to free + * @ptr: Pointer to memory block to free. If this is NULL then this + * function does nothing */ void os_free(void *ptr); |