[PATCH 8/8] drivers/core: use memdup() instead of malloc()+memcpy()
Simon Glass
sjg at chromium.org
Mon Apr 13 16:57:27 CEST 2026
On 2026-04-12T19:59:41, Rasmus Villemoes <ravi at prevas.dk> wrote:
> drivers/core: use memdup() instead of malloc()+memcpy()
>
> Use memdup() instead of open-coding it.
>
> In the dm_setup_inst() case, there was never any reason to use
> calloc(), as the whole allocation is definitely initialized via the
> immediately following memcpy().
>
> Signed-off-by: Rasmus Villemoes <ravi at prevas.dk>
>
> drivers/core/acpi.c | 3 +--
> drivers/core/ofnode.c | 3 +--
> drivers/core/root.c | 3 +--
> 3 files changed, 3 insertions(+), 6 deletions(-)
Reviewed-by: Simon Glass <sjg at chromium.org>
More information about the U-Boot
mailing list