Skip to content

Commit 2f02474

Browse files
PavelVPVnashif
authored andcommitted
bluetooth: host: adv: Release buf if failed to set addr
The `bt_id_set_adv_own_addr` function itself tries to allocate a buffer for the command and it failes due to lack of buffers, it returns error. However, the `le_ext_adv_param_set` function doesn't handle the error properly and keeps its own allocated buffer. This commit releases the allocated buffer. Partially fixes mesh in #77241. Signed-off-by: Pavel Vasilyev <[email protected]>
1 parent ad0c1e1 commit 2f02474

File tree

1 file changed

+1
-0
lines changed
  • subsys/bluetooth/host

1 file changed

+1
-0
lines changed

subsys/bluetooth/host/adv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,7 @@ static int le_ext_adv_param_set(struct bt_le_ext_adv *adv,
11391139
err = bt_id_set_adv_own_addr(adv, param->options, dir_adv,
11401140
&cp->own_addr_type);
11411141
if (err) {
1142+
net_buf_unref(buf);
11421143
return err;
11431144
}
11441145

0 commit comments

Comments
 (0)