Skip to content
Commit 008a82e3 authored by Pirun Lee's avatar Pirun Lee Committed by Carles Cufí
Browse files

Bluetooth: OTS: Fix memory leak while procedure is not finished



cur_inst is the copy of ots_client instance to prevent duplicate
API call while client is in middle of read/write procedure.
But cur_inst can only be cleared while write_obj_tx_done or read rx_done.
If ACL is disconnected while read/write is on-going, there is no chance
for cur_inst being cleared.
This causes ots client will no longer perform select/read/write
procedure anymore. API will always return -EBUSY.

Let l2cap_disconnect check if cur_inst is NULL and NULL it
unconditionally as what it is designed.

Make bt_ots_client_unregister public API.

Signed-off-by: default avatarPirun Lee <pirun.lee@nordicsemi.no>
parent 37f4cb16
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment