summaryrefslogtreecommitdiff
path: root/lib/hash-checksum.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-09-04 10:51:58 -0400
committerTom Rini <trini@konsulko.com>2023-09-04 10:51:58 -0400
commitddec4cae624e48c3678ea856fa7d6292a7104238 (patch)
treebb04231fb05cf9d3fc018bf874bbb6e8373968d8 /lib/hash-checksum.c
parentf2bb6d9ffd9ba0d0d89c00445a70cf81327a7af2 (diff)
parentb27eeca112c1b9eef6f06a320a4310d766ac5659 (diff)
Merge tag 'v2023.10-rc4' into next
Prepare v2023.10-rc4
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)