mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-11 09:47:00 +02:00
arm64: zynqmp: Check return value from calloc
calloc() can fail and return NULL. The patch is checking return value and return in case of error. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
parent
b6911780b5
commit
1e3e68f109
@ -596,6 +596,8 @@ int board_late_init(void)
|
|||||||
|
|
||||||
new_targets = calloc(1, strlen(mode) + env_targets_len + 2 +
|
new_targets = calloc(1, strlen(mode) + env_targets_len + 2 +
|
||||||
bootseq_len);
|
bootseq_len);
|
||||||
|
if (!new_targets)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
if (bootseq >= 0)
|
if (bootseq >= 0)
|
||||||
sprintf(new_targets, "%s%x %s", mode, bootseq,
|
sprintf(new_targets, "%s%x %s", mode, bootseq,
|
||||||
|
Loading…
Reference in New Issue
Block a user