mirror of
https://github.com/trabucayre/openFPGALoader.git
synced 2026-08-22 06:07:36 +02:00
main: always check if board is not null before access
This commit is contained in:
+2
-2
@@ -252,7 +252,7 @@ int main(int argc, char **argv)
|
||||
spi_ret = EXIT_FAILURE;
|
||||
} else {
|
||||
RawParser *bit = NULL;
|
||||
if (board->reset_pin) {
|
||||
if (board && board->reset_pin) {
|
||||
spi->gpio_set_output(board->reset_pin, true);
|
||||
spi->gpio_clear(board->reset_pin, true);
|
||||
}
|
||||
@@ -302,7 +302,7 @@ int main(int argc, char **argv)
|
||||
if (!flash.enable_protection(args.protect_flash))
|
||||
spi_ret = EXIT_FAILURE;
|
||||
|
||||
if (board->reset_pin)
|
||||
if (board && board->reset_pin)
|
||||
spi->gpio_set(board->reset_pin, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user