summaryrefslogtreecommitdiff
path: root/lib/hash-checksum.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-08-27 11:04:02 -0400
committerTom Rini <trini@konsulko.com>2023-08-27 11:04:02 -0400
commit6a1d3f64c201ed3f6df819cfcf08154b6ec1c02e (patch)
tree566da16c29bc65dabc09afeea06c9840bbb37a90 /lib/hash-checksum.c
parente508b930021168c788f14977fc101ccc1151b3c8 (diff)
parentcc889bd0754e50a3cd50e8ed3094388480fbec86 (diff)
Merge tag 'efi-2023-10-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2023-10-rc4 Documentation: * describe TPL/VPL/SPL boot * Add support for sphinx-prompt and convert TI K3 to use it * board: sdm845: Explicitly add boot.img flashing command EFI: * remove handle from events when deleting it Others: * fix gpt sub-commands setenv and enumerate * add a parameter check in hash_calculate()
Diffstat (limited to 'lib/hash-checksum.c')
-rw-r--r--lib/hash-checksum.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/hash-checksum.c b/lib/hash-checksum.c
index 8f2a42f9a08..68c290d64d8 100644
--- a/lib/hash-checksum.c
+++ b/lib/hash-checksum.c
@@ -23,8 +23,10 @@ int hash_calculate(const char *name,
struct hash_algo *algo;
int ret = 0;
void *ctx;
- uint32_t i;
- i = 0;
+ int i;
+
+ if (region_count < 1)
+ return -EINVAL;
ret = hash_progressive_lookup_algo(name, &algo);
if (ret)