]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: Fix reference counting of global L2CAP channels
authorJohan Hedberg <johan.hedberg@intel.com>
Thu, 7 Aug 2014 19:56:42 +0000 (22:56 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 14 Aug 2014 06:49:11 +0000 (08:49 +0200)
commitff2343292a91ad56ccd713633850740991cfe723
tree58692975c72de95cdda4b3c0a68db88ac4166a12
parentfae7efe275da006f35f6b77ad98699701ef379da
Bluetooth: Fix reference counting of global L2CAP channels

When looking up entries from the global L2CAP channel list there needs
to be a guarantee that other code doesn't go and remove the entry after
a channel has been returned by the lookup function. This patch makes
sure that the channel reference is incremented before the read lock is
released in the global channel lookup functions. The patch also adds the
corresponding l2cap_chan_put() calls once the channels pointers are
no-longer needed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/l2cap_core.c