]> git.ipfire.org Git - thirdparty/u-boot.git/commit
xilinx: zynqmp: Use strlen only if env_get doesn't return null
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Wed, 20 Dec 2017 11:05:06 +0000 (16:35 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 31 Jan 2018 12:15:43 +0000 (13:15 +0100)
commita6ae5b54be1a407a18752ec786e815ed17d2a77a
tree804e141b6d263cd9d5794bd5559715d18a587ab4
parentdf99e54c443bd9e87f3ad57c39ffd243d8aff58a
xilinx: zynqmp: Use strlen only if env_get doesn't return null

Add check if boot_targets exists in environment and then
generate new_targets env accordingly. Performing strlen on
null address causes it to fail with exception if isolation
is enabled with DDR address zero as secure. It works with out
isolation enabled as zero is valid address but it may lead to
junk values in boot_targets.
This patch fixes the issue by checking return value of env_get
so that it generate boot_targets properly.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
board/xilinx/zynqmp/zynqmp.c