Files
rtems/cpukit/dev/flash
Cheng Mingming a241e49bda 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 ) where alloc_array_len
held the number of uint32_t words.  Since bit_allocator is a uint32_t
array, only one byte per word 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.

Rename RTEMS_FLASHDEV_BITALLOC_LENGTH to RTEMS_FLASHDEV_BITALLOC_WORD_LENGTH
to make the word count explicit, add RTEMS_FLASHDEV_BITALLOC_BYTE_LENGTH for
the size in bytes, and clear the whole bitmap using the byte length.
2026-06-10 09:42:54 +08:00
..