From 0f4767fd1e1eff8e20f82778e340b534af7ab190 Mon Sep 17 00:00:00 2001 From: Sergii Dmytruk Date: Wed, 17 Aug 2022 18:29:10 +0300 Subject: writeprotect.c: refuse to work with chip if OTP WPS == 1 Perform the check right in read_wp_bits() as it's used by various WP operations and also because its results won't make sense if WPS bit is on and can't be changed. Change-Id: I143186066a1d3af89809b7135886cb8b0d038085 Signed-off-by: Sergii Dmytruk Reviewed-on: https://review.coreboot.org/c/flashrom/+/66836 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Nikolai Artemiev --- cli_classic.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cli_classic.c') diff --git a/cli_classic.c b/cli_classic.c index 574afff1..bd98a07d 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -202,6 +202,8 @@ static const char *get_wp_error_str(int err) return "the requested protection range is not supported"; case FLASHROM_WP_ERR_RANGE_LIST_UNAVAILABLE: return "could not determine what protection ranges are available"; + case FLASHROM_WP_ERR_UNSUPPORTED_STATE: + return "can't operate on current WP configuration of the chip"; } return "unknown WP error"; } -- cgit v1.2.3