hw/arm/orangepi: check for potential NULL pointer when calling blk_is_available
commitc251191eae40e0e26680d0d8a8a065735acadef8
authorNiek Linnenbank <nieklinnenbank@gmail.com>
Mon, 30 Mar 2020 12:18:58 +0000 (30 13:18 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 30 Mar 2020 12:18:58 +0000 (30 13:18 +0100)
treebaf0ceaccf9ccc0ba31184a6d68e0247b1b9b328
parentf9fe8450fa7cdc6268e05c93fa258f583f4514b7
hw/arm/orangepi: check for potential NULL pointer when calling blk_is_available

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 <peter.maydell@linaro.org>
Signed-off-by: Niek Linnenbank <nieklinnenbank@gmail.com>
Message-id: 20200322205439.15231-1-nieklinnenbank@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/orangepi.c