]> Git Repo - qemu.git/commitdiff
hw/arm/orangepi: check for potential NULL pointer when calling blk_is_available
authorNiek Linnenbank <[email protected]>
Mon, 30 Mar 2020 12:18:58 +0000 (13:18 +0100)
committerPeter Maydell <[email protected]>
Mon, 30 Mar 2020 12:18:58 +0000 (13:18 +0100)
The Orange Pi PC initialization function needs to verify that the SD card
block backend is usable before calling the Boot ROM setup routine. When
calling blk_is_available() the input parameter should not be NULL.
This commit ensures that blk_is_available is only called with non-NULL input.

Reported-by: Peter Maydell <[email protected]>
Signed-off-by: Niek Linnenbank <[email protected]>
Message-id: 20200322205439[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
hw/arm/orangepi.c

index 181f5badab78dd5427130524dba8adbf79614a2e..a9f64c56800b6a4ff5f8141750d7ba5f1d9af800 100644 (file)
@@ -104,7 +104,7 @@ static void orangepi_init(MachineState *machine)
                                 machine->ram);
 
     /* Load target kernel or start using BootROM */
-    if (!machine->kernel_filename && blk_is_available(blk)) {
+    if (!machine->kernel_filename && blk && blk_is_available(blk)) {
         /* Use Boot ROM to copy data from SD card to SRAM */
         allwinner_h3_bootrom_setup(h3, blk);
     }
This page took 0.026679 seconds and 4 git commands to generate.