From: Leo Liang <ycliang@andestech.com>
To: Hanyuan Zhao <hanyuan-z@qq.com>
Cc: <u-boot@lists.denx.de>, Bin Meng <bmeng.cn@gmail.com>,
Hanyuan Zhao <zhaohy22@mails.tsinghua.edu.cn>
Subject: Re: [PATCH 1/1] riscv: add NULL check before calling strlen in the riscv cpu's get_desc()
Date: Tue, 14 May 2024 18:07:43 +0800 [thread overview]
Message-ID: <ZkM37xOy2DRhMMYz@swlinux02> (raw)
In-Reply-To: <tencent_6178F4CBD2326AD3FE5FBAA496630920D405@qq.com>
On Mon, May 06, 2024 at 05:10:06PM +0800, Hanyuan Zhao wrote:
> 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: Hanyuan Zhao <zhaohy22@mails.tsinghua.edu.cn>
> ---
> drivers/cpu/riscv_cpu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
prev parent reply other threads:[~2024-05-14 10:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-06 9:10 [PATCH 1/1] riscv: add NULL check before calling strlen in the riscv cpu's get_desc() Hanyuan Zhao
2024-05-14 10:07 ` Leo Liang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZkM37xOy2DRhMMYz@swlinux02 \
--to=ycliang@andestech.com \
--cc=bmeng.cn@gmail.com \
--cc=hanyuan-z@qq.com \
--cc=u-boot@lists.denx.de \
--cc=zhaohy22@mails.tsinghua.edu.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox