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 --- include/libflashrom.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/libflashrom.h b/include/libflashrom.h index 9bbdcc5d..bac76c2c 100644 --- a/include/libflashrom.h +++ b/include/libflashrom.h @@ -464,7 +464,8 @@ enum flashrom_wp_result { FLASHROM_WP_ERR_VERIFY_FAILED = 5, FLASHROM_WP_ERR_RANGE_UNSUPPORTED = 6, FLASHROM_WP_ERR_MODE_UNSUPPORTED = 7, - FLASHROM_WP_ERR_RANGE_LIST_UNAVAILABLE = 8 + FLASHROM_WP_ERR_RANGE_LIST_UNAVAILABLE = 8, + FLASHROM_WP_ERR_UNSUPPORTED_STATE = 9 }; enum flashrom_wp_mode { -- cgit v1.2.3