Skip to content

Commit e395c6c

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: controller: Fix uninitialized ULL reference count
Fix missing initialization of reference count in ull_hdr_init function. This has not caused issues so far, but when the ref member of the struct ull_hdr if placed in the beginning of a context that is allocated using mem_acquire function then first few bytes used would make the ref member to have uninitialized value when such context is allocated by mem_acquire. First few bytes are the next pointer and free count stored by the mem module. The issue was discovered in subsequent commits that restructure the ULL context structures. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 624e003 commit e395c6c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

subsys/bluetooth/controller/ll_sw/ull_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static inline uint8_t ull_ref_dec(struct ull_hdr *hdr)
2727

2828
static inline void ull_hdr_init(struct ull_hdr *hdr)
2929
{
30+
hdr->ref = 0U;
3031
hdr->disabled_cb = hdr->disabled_param = NULL;
3132
}
3233

0 commit comments

Comments
 (0)