[PATCH v2 11/13] selftests/mm: fix double increment in linked list cleanup in compaction_test

David Hildenbrand (Arm) david at kernel.org
Thu Mar 12 23:51:18 AEDT 2026


On 3/12/26 13:25, Sayali Patil wrote:
> The cleanup loop of allocated memory currently uses:
> 
>     for (entry = list; entry != NULL; entry = entry->next) {
>         munmap(entry->map, MAP_SIZE);
>         if (!entry->next)
>             break;
>         entry = entry->next;
>     }
> 
> The inner entry = entry->next causes the loop to skip every
> other node, resulting in only half of the mapped regions being
> unmapped.
> 
> Remove the redundant increment to ensure every entry is visited
> and unmapped during cleanup.
> 
> Fixes: bd67d5c15cc1 ("Test compaction of mlocked memory")
> Reviewed-by: Zi Yan <ziy at nvidia.com>
> Signed-off-by: Sayali Patil <sayalip at linux.ibm.com>

Acked-by: David Hildenbrand (Arm) <david at kernel.org>

-- 
Cheers,

David


More information about the Linuxppc-dev mailing list