This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 5609c3d416 mm/mm_gran: fix compile warnings
5609c3d416 is described below

commit 5609c3d4166905b224020ef70c5847367616889a
Author: xuxingliang <[email protected]>
AuthorDate: Wed Oct 16 14:40:08 2024 +0800

    mm/mm_gran: fix compile warnings
    
    mm_gran/mm_grantable.c:187:6: error: 'r.sidx' may be used uninitialized
    
    Signed-off-by: xuxingliang <[email protected]>
---
 mm/mm_gran/mm_grantable.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mm/mm_gran/mm_grantable.c b/mm/mm_gran/mm_grantable.c
index 84c8077d93..3be7d99751 100644
--- a/mm/mm_gran/mm_grantable.c
+++ b/mm/mm_gran/mm_grantable.c
@@ -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 */
 

Reply via email to