From 34a572b226100ab96cb7c1dbe5af407929d68bcb Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 17 Oct 2017 07:34:06 -0600 Subject: [PATCH] Update last commit... Check should really use the definition MMSIZE_MAX which is really the same thing, but guaranteed to be the correct maximum size in any present and future configuration. --- mm/mm_heap/mm_malloc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/mm_heap/mm_malloc.c b/mm/mm_heap/mm_malloc.c index 98b9cac244..430b7ac5b8 100644 --- a/mm/mm_heap/mm_malloc.c +++ b/mm/mm_heap/mm_malloc.c @@ -76,11 +76,7 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size) /* Handle bad sizes */ -#ifndef CONFIG_MM_SMALL - if (size < 1 || size > (UINT32_MAX - SIZEOF_MM_ALLOCNODE)) -#else - if (size < 1 || size > (UINT16_MAX - SIZEOF_MM_ALLOCNODE)) -#endif + if (size < 1 || size > (MMSIZE_MAX - SIZEOF_MM_ALLOCNODE)) { return NULL; }