Bluetooth: L2CAP: Reset channel status before destroy callback
Move reset of channel status from after the destroy callback since the after the destroy callback the memory should be assumed to be released. Instead clear the channel status when the channel is created in l2cap_chan_add. This way we don't rely on the memory given being set to the correct value. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
d84528edb1
commit
576c68317a
1 changed files with 1 additions and 1 deletions
|
@ -257,7 +257,6 @@ destroy:
|
|||
chan->destroy(chan);
|
||||
}
|
||||
|
||||
atomic_clear(chan->status);
|
||||
}
|
||||
|
||||
static void l2cap_rtx_timeout(struct k_work *work)
|
||||
|
@ -315,6 +314,7 @@ static bool l2cap_chan_add(struct bt_conn *conn, struct bt_l2cap_chan *chan,
|
|||
}
|
||||
|
||||
k_delayed_work_init(&chan->rtx_work, l2cap_rtx_timeout);
|
||||
atomic_clear(chan->status);
|
||||
|
||||
bt_l2cap_chan_add(conn, chan, destroy);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue