Skip to content
Commit 9578e745 authored by Hanyuan Zhao's avatar Hanyuan Zhao Committed by Leo Yu-Chi Liang
Browse files

riscv: add NULL check before calling strlen in the riscv cpu's get_desc()



Without the NULL check, if the devicetree that u-boot loads does not have a
compatible property then a store access fault will be raised and force the
machine to reset, due to the NULL pointer we passed to strlen. This commit
adds this check and will return -ENOSPC to indicate the get_desc failed.

Signed-off-by: default avatarHanyuan Zhao <zhaohy22@mails.tsinghua.edu.cn>
Reviewed-by: default avatarLeo Yu-Chi Liang <ycliang@andestech.com>
parent c8ffd135
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment