diff options
author | Michal Simek <michal.simek@xilinx.com> | 2018-06-13 09:42:41 +0200 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2018-06-15 08:54:05 +0200 |
commit | 1e3e68f109d6f4ac934319dee9e7928cfdce895c (patch) | |
tree | aebc32db43eb51a195644eeeb65f82b4cdd80f13 /board/xilinx | |
parent | b6911780b5b494bc2a455039082990c960190ddc (diff) | |
download | u-boot-1e3e68f109d6f4ac934319dee9e7928cfdce895c.tar.gz u-boot-1e3e68f109d6f4ac934319dee9e7928cfdce895c.tar.bz2 u-boot-1e3e68f109d6f4ac934319dee9e7928cfdce895c.zip |
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>
Diffstat (limited to 'board/xilinx')
-rw-r--r-- | board/xilinx/zynqmp/zynqmp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 080fb59ef7..81c10fcf8a 100644 --- 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, |