[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 04/11] hw/riscv/boot.c: exit early if filename is NULL in
From: |
Bin Meng |
Subject: |
Re: [PATCH v5 04/11] hw/riscv/boot.c: exit early if filename is NULL in load functions |
Date: |
Sun, 8 Jan 2023 11:30:23 +0800 |
On Mon, Jan 2, 2023 at 7:54 PM Daniel Henrique Barboza
<dbarboza@ventanamicro.com> wrote:
>
> riscv_load_firmware(), riscv_load_initrd() and riscv_load_kernel() works
> under the assumption that a 'filename' parameter is always not NULL.
>
> This is currently the case since all callers of these functions are
> checking for NULL before calling them. Add an g_assert() to make sure
> that a NULL value in these cases are to be considered a bug.
>
> Suggested-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
> ---
> hw/riscv/boot.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
- [PATCH v5 00/11] riscv: OpenSBI boot test and cleanups, Daniel Henrique Barboza, 2023/01/02
- [PATCH v5 01/11] tests/avocado: add RISC-V OpenSBI boot test, Daniel Henrique Barboza, 2023/01/02
- [PATCH v5 02/11] hw/riscv/spike: use 'fdt' from MachineState, Daniel Henrique Barboza, 2023/01/02
- [PATCH v5 03/11] hw/riscv/sifive_u: use 'fdt' from MachineState, Daniel Henrique Barboza, 2023/01/02
- [PATCH v5 04/11] hw/riscv/boot.c: exit early if filename is NULL in load functions, Daniel Henrique Barboza, 2023/01/02
- [PATCH v5 05/11] hw/riscv/spike.c: load initrd right after riscv_load_kernel(), Daniel Henrique Barboza, 2023/01/02
- [PATCH v5 06/11] hw/riscv: write initrd 'chosen' FDT inside riscv_load_initrd(), Daniel Henrique Barboza, 2023/01/02
- [PATCH v5 07/11] hw/riscv: write bootargs 'chosen' FDT after riscv_load_kernel(), Daniel Henrique Barboza, 2023/01/02
- [PATCH v5 08/11] hw/riscv/boot.c: use MachineState in riscv_load_initrd(), Daniel Henrique Barboza, 2023/01/02
- [PATCH v5 09/11] hw/riscv/boot.c: use MachineState in riscv_load_kernel(), Daniel Henrique Barboza, 2023/01/02