summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cli_classic.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/cli_classic.c b/cli_classic.c
index bac31d1c1..3de00206f 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -1110,9 +1110,17 @@ int main(int argc, char *argv[])
if (any_wp_op) {
if (set_wp_region && wp_region) {
+ if (!layout) {
+ msg_gerr("Error: A flash layout must be specified to use --wp-region.\n");
+ ret = 1;
+ goto out_release;
+ }
+
ret = flashrom_layout_get_region_range(layout, wp_region, &wp_start, &wp_len);
- if (ret)
+ if (ret) {
+ msg_gerr("Error: Region %s not found in flash layout.\n", wp_region);
goto out_release;
+ }
set_wp_range = true;
}
ret = wp_cli(