livetree: fix off-by-one in propval_cell_n() bounds check

Signed-off-by: Johannes Beisswenger <johannes.beisswenger@cetitec.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Johannes Beisswenger 2023-05-10 11:16:19 +02:00 committed by David Gibson
parent ab481e4830
commit b2b9671583
1 changed files with 1 additions and 1 deletions

View File

@ -441,7 +441,7 @@ cell_t propval_cell(struct property *prop)

cell_t propval_cell_n(struct property *prop, unsigned int n)
{
assert(prop->val.len / sizeof(cell_t) >= n);
assert(prop->val.len / sizeof(cell_t) > n);
return fdt32_to_cpu(*((fdt32_t *)prop->val.val + n));
}