diff options
author | Dmitrii Merkurev <dimorinny@google.com> | 2024-02-12 12:53:16 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-02-12 12:53:16 +0000 |
commit | e25919d3a133b78691b7287db3f461db74be0562 (patch) | |
tree | 18a293e4e3a2b46ce3883bb56c37ef49dc1cee0f | |
parent | 844e5b694632edace623a09a32a1d4ee13dd0707 (diff) | |
parent | d58779cb6425416074fce00f36066d76dc6d850b (diff) | |
download | u-boot-e25919d3a133b78691b7287db3f461db74be0562.tar.gz |
Merge "Disallow flashing locked device" into main
-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); |