fix case where ta_get_context could return an unallocated context for

address 0, as it was iterating over all available contexts, not just
the allocated ones
This commit is contained in:
Anthony Pesch 2017-11-29 23:22:44 -05:00
parent 621f65ca78
commit ff4eefa36d
1 changed files with 1 additions and 1 deletions

View File

@ -349,7 +349,7 @@ static holly_interrupt_t list_interrupts[] = {
};
static struct ta_context *ta_get_context(struct ta *ta, uint32_t addr) {
for (int i = 0; i < ARRAY_SIZE(ta->contexts); i++) {
for (int i = 0; i < ta->num_contexts; i++) {
struct ta_context *ctx = &ta->contexts[i];
if (ctx->addr == addr) {
return ctx;