Skip to content

Commit

Permalink
checks: Check the overall length of "interrupt-map"
Browse files Browse the repository at this point in the history
It is possible the overall length of "interrupt-map" is shorter than
expected. A likely scenario is if "#address-cells" in the interrupt
parent is not accounted for and there is only a single map entry. With
multiple entries, one of the other tests would likely fail.

Signed-off-by: Rob Herring (Arm) <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: David Gibson <[email protected]>
  • Loading branch information
robherring authored and dgibson committed Jun 1, 2024
1 parent ae26223 commit c17d76a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions checks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,10 @@ static void check_interrupt_map(struct check *c,
parent_cellsize += propval_cell(cellprop);

cell += 1 + parent_cellsize;
if (cell > map_cells)
FAIL_PROP(c, dti, node, irq_map_prop,
"property size (%d) mismatch, expected %zu",
irq_map_prop->val.len, cell * sizeof(cell_t));
}
}
WARNING(interrupt_map, check_interrupt_map, NULL, &phandle_references, &addr_size_cells, &interrupt_provider);
Expand Down

0 comments on commit c17d76a

Please sign in to comment.