summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/cbfstool/cbfs_image.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index 2b250114d0..1cfe90d273 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -1389,7 +1389,9 @@ struct cbfs_file_attribute *cbfs_add_file_attr(struct cbfs_file *header,
int cbfs_add_file_hash(struct cbfs_file *header, struct buffer *buffer,
enum vb2_hash_algorithm hash_type)
{
- if (hash_type >= CBFS_NUM_SUPPORTED_HASHES)
+ uint32_t hash_index = hash_type;
+
+ if (hash_index >= CBFS_NUM_SUPPORTED_HASHES)
return -1;
unsigned hash_size = widths_cbfs_hash[hash_type];