diff options
-rw-r--r-- | drivers/fastboot/fb_command.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c index a4af564cfe..2f3e25ae3e 100644 --- a/drivers/fastboot/fb_command.c +++ b/drivers/fastboot/fb_command.c @@ -219,6 +219,9 @@ static void download(char *cmd_parameter, char *response) { char *tmp; + if (!ensure_device_is_unlocked("Download is not allowed on locked devices", response)) + return; + if (!cmd_parameter) { fastboot_fail("Expected command parameter", response); return; @@ -328,6 +331,9 @@ void fastboot_data_complete(char *response) */ static void __maybe_unused flash(char *cmd_parameter, char *response) { + if (!ensure_device_is_unlocked("Flashing is not allowed on locked devices", response)) + return; + if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_BLOCK)) fastboot_block_flash_write(cmd_parameter, fastboot_buf_addr, image_size, response); |