mm/mm_gran: fix compile warnings

mm_gran/mm_grantable.c:187:6: error: 'r.sidx' may be used uninitialized

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
xuxingliang 2024-10-16 14:40:08 +08:00 committed by Xiang Xiao
parent 8c98194182
commit 5609c3d416

View file

@ -174,7 +174,10 @@ bool gran_match(const gran_t *gran, size_t posi, size_t size, bool used,
uint32_t e; /* expected cell value */
gatr_t r; /* range helper */
gran_range(gran, posi, size, &r);
if (gran_range(gran, posi, size, &r) < 0)
{
memset(&r, 0, sizeof(r));
}
/* check the ending cell */