diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2015-11-11 21:47:12 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-11-11 23:48:34 +0100 |
commit | 7883746bc663150e8acd7a57397fc889698b0b33 (patch) | |
tree | fc563a53515efdb1ecc2a42291adf42505e7b03b /net/rxrpc/ar-input.c | |
parent | c5a37883f42be712a989e54d5d6c0159b0e56599 (diff) | |
download | talos-obmc-linux-7883746bc663150e8acd7a57397fc889698b0b33.tar.gz talos-obmc-linux-7883746bc663150e8acd7a57397fc889698b0b33.zip |
Bluetooth: Fix l2cap_chan leak in SMP
The L2CAP core expects channel implementations to manage the reference
returned by the new_connection callback. With sockets this is already
handled with each channel being tied to the corresponding socket. With
SMP however there's no context to tie the pointer to in the
smp_new_conn_cb function. The function can also not just drop the
reference since it's the only one at that point.
For fixed channels (like SMP) the code path inside the L2CAP core from
new_connection() to ready() is short and straight-forwards. The
crucial difference is that in ready() the implementation has access to
the l2cap_conn that SMP needs associate its l2cap_chan. Instead of
taking a new reference in smp_ready_cb() we can simply assume to
already own the reference created in smp_new_conn_cb(), i.e. there is
no need to call l2cap_chan_hold().
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: stable@vger.kernel.org # 3.19+
Diffstat (limited to 'net/rxrpc/ar-input.c')
0 files changed, 0 insertions, 0 deletions