|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PATCH v4 04/11] hw/riscv/boot.c: exit early if filename is NULL in load_(kernel|initrd) |
Date: | Fri, 30 Dec 2022 13:50:01 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 |
On 30/12/22 09:58, Bin Meng wrote:
On Fri, Dec 30, 2022 at 2:21 AM Daniel Henrique Barboza <dbarboza@ventanamicro.com> wrote:riscv_load_kernel() and riscv_load_initrd() works under the assumption that 'kernel_filename' and 'filename' are not NULL.We should do the same in riscv_load_firmware()
Can be done on top IMHO.
This is currently the case since all callers of both functions are checking for NULL before calling them. Put an assert in both to make sure that a NULL value for both cases would be considered a bug. Suggested-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> --- hw/riscv/boot.c | 4 ++++ 1 file changed, 4 insertions(+)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[Prev in Thread] | Current Thread | [Next in Thread] |