diff options
author | Volodymyr Babchuk <vlad.babchuk@gmail.com> | 2018-12-17 18:14:43 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2019-02-01 14:56:34 +0100 |
commit | 4a810b9074506441872ed6f1d752b45c034d19df (patch) | |
tree | 06b719b77d45464f7934c96adf25abf55d177ae0 | |
parent | cebd81a844cbe99894b08b0decc4f15d28dbbce6 (diff) |
console: use nex_strdup() instead of strdup()
strdup() uses malloc() internally, which is not good for
nexus part of OP-TEE.
Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r-- | core/kernel/console.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/kernel/console.c b/core/kernel/console.c index 5d5e9554..2ae3229e 100644 --- a/core/kernel/console.c +++ b/core/kernel/console.c @@ -10,6 +10,7 @@ #include <kernel/panic.h> #include <stdlib.h> #include <string.h> +#include <string_ext.h> #ifdef CFG_DT #include <kernel/dt.h> @@ -91,7 +92,7 @@ TEE_Result get_console_node_from_dt(void **fdt_out, int *offs_out, return TEE_ERROR_ITEM_NOT_FOUND; } - stdout_data = strdup(prop->data); + stdout_data = nex_strdup(prop->data); if (!stdout_data) panic(); p = strchr(stdout_data, ':'); @@ -120,7 +121,7 @@ TEE_Result get_console_node_from_dt(void **fdt_out, int *offs_out, rc = TEE_SUCCESS; } - free(stdout_data); + nex_free(stdout_data); return rc; } |