diff options
Diffstat (limited to 'drivers/hab/habv4.c')
-rw-r--r-- | drivers/hab/habv4.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c index 496fbe3ccd..6a60be6853 100644 --- a/drivers/hab/habv4.c +++ b/drivers/hab/habv4.c @@ -419,7 +419,7 @@ static bool is_known_rng_fail_event(const uint8_t *data, size_t len) int i; for (i = 0; i < ARRAY_SIZE(habv4_known_rng_fail_events); i++) { if (memcmp(data, habv4_known_rng_fail_events[i], - min(len, (uint32_t)RNG_FAIL_EVENT_SIZE)) == 0) { + min_t(size_t, len, RNG_FAIL_EVENT_SIZE)) == 0) { return true; } } @@ -469,6 +469,7 @@ static int habv4_get_status(const struct habv4_rvt *rvt) } len = sizeof(data); + index = 0; while (rvt->report_event(HAB_STATUS_FAILURE, index, data, &len) == HAB_STATUS_SUCCESS) { pr_err("-------- HAB failure Event %d --------\n", index); pr_err("event data:\n"); @@ -480,6 +481,7 @@ static int habv4_get_status(const struct habv4_rvt *rvt) /* Check reason for stopping */ len = sizeof(data); + index = 0; if (rvt->report_event(HAB_STATUS_ANY, index, NULL, &len) == HAB_STATUS_SUCCESS) pr_err("ERROR: Recompile with larger event data buffer (at least %d bytes)\n\n", len); |