AVR_ISP: fix NULL pointer dereference

This commit is contained in:
SkorP 2023-04-10 20:39:33 +04:00 committed by MX
parent c2fa8a2b18
commit 243fbfc19a
No known key found for this signature in database
GPG Key ID: 7CCC66B7DBDD1C83
2 changed files with 2 additions and 0 deletions

View File

@ -153,6 +153,7 @@ bool avr_isp_auto_set_spi_speed_start_pmode(AvrIsp* instance) {
} }
} }
if(instance->spi) avr_isp_spi_sw_free(instance->spi); if(instance->spi) avr_isp_spi_sw_free(instance->spi);
instance->spi = NULL;
return false; return false;
} }

View File

@ -318,6 +318,7 @@ static bool avr_isp_prog_auto_set_spi_speed_start_pmode(AvrIspProg* instance) {
} }
} }
if(instance->spi) avr_isp_spi_sw_free(instance->spi); if(instance->spi) avr_isp_spi_sw_free(instance->spi);
instance->spi = NULL;
return false; return false;
} }