mirror of
https://github.com/blackmagic-debug/blackmagic.git
synced 2025-10-14 02:58:36 +08:00
target_flash: Prevent NULL dereference when detached from targets
This commit is contained in:
@@ -300,7 +300,7 @@ bool target_flash_write(target_s *target, target_addr_t dest, const void *src, s
|
||||
|
||||
bool target_flash_complete(target_s *target)
|
||||
{
|
||||
if (!target->flash_mode)
|
||||
if (!target || !target->flash_mode)
|
||||
return false;
|
||||
|
||||
bool result = true; /* Catch false returns with &= */
|
||||
|
Reference in New Issue
Block a user