Re: [PATCH 1/2] Bluetooth: L2CAP: avoid maybe-return-locked and add locking annotations

From: Bart Van Assche

Date: Mon Jul 13 2026 - 13:19:52 EST


On 7/12/26 5:42 AM, Pauli Virtanen wrote:
Replace the maybe-return-locked behavior of
l2cap_get_chan_by_scid/dcid() by doing locking in the caller after NULL
check. This allows the static context analysis to handle this. No
functional change intended.

Add context analysis annotations related to l2cap_chan_lock/unlock().
As one can see in the above description, this patch includes two
separate changes. Please split this patch into two patches: one patch
with the code refactoring and a second patch that adds the context
analysis annotations.

Thanks,

Bart.