1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 06:01:16 +02:00

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 <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66836
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
This commit is contained in:
Sergii Dmytruk
2022-08-17 18:29:10 +03:00
committed by Anastasia Klimchuk
parent 6d475ec4ab
commit 0f4767fd1e
3 changed files with 23 additions and 3 deletions

View File

@ -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 {