projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b691178
)
arm64: zynqmp: Check return value from calloc
author
Michal Simek
<michal.simek@xilinx.com>
Wed, 13 Jun 2018 07:42:41 +0000
(09:42 +0200)
committer
Michal Simek
<michal.simek@xilinx.com>
Fri, 15 Jun 2018 06:54:05 +0000
(08:54 +0200)
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>
board/xilinx/zynqmp/zynqmp.c
patch
|
blob
|
history
diff --git
a/board/xilinx/zynqmp/zynqmp.c
b/board/xilinx/zynqmp/zynqmp.c
index 080fb59ef7bdaa458cc7d2ad833a846f06a85066..81c10fcf8a00c6a227f1967e5d934a2cb2d58f7e 100644
(file)
--- a/
board/xilinx/zynqmp/zynqmp.c
+++ b/
board/xilinx/zynqmp/zynqmp.c
@@
-596,6
+596,8
@@
int board_late_init(void)
new_targets = calloc(1, strlen(mode) + env_targets_len + 2 +
bootseq_len);
+ if (!new_targets)
+ return -ENOMEM;
if (bootseq >= 0)
sprintf(new_targets, "%s%x %s", mode, bootseq,