mingming cheng created a merge request: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1280

Project:Branches: kymm/rtems:main to rtems/rtos/rtems:main
Author:   mingming cheng



## Summary

cpukit/dev/flash: Fix region bitmap clear size

rtems_flashdev_register() cleared the region allocator bitmap with
memset( table->bit_allocator, 0, alloc_array_len ).  Since bit_allocator
is a uint32_t array and alloc_array_len is the number of uint32_t
elements, only one byte per element was zeroed, leaving the rest of the
bitmap uninitialised.  Stale bits can make
rtems_flashdev_find_unallocated_region() report region slots as
allocated and fail REGION_SET with ENOMEM while slots are actually free.

Multiply the element count by sizeof( uint32_t ) so the whole bitmap is
cleared.


## Generative AI

<!-- If you have used AI please use the "AI Contribution" template otherwise 
leave this blank see our fulls statement at 
https://www.rtems.org/generative-ai/-->


<!-- Default settings, if it is a dropdown it will set after submission -->

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1280
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to