Bluetooth: Free up l2cap_chan->sport when initiating a connection
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 28 Jan 2014 23:16:48 +0000 (15:16 -0800)
committerJohan Hedberg <johan.hedberg@intel.com>
Thu, 13 Feb 2014 07:51:38 +0000 (09:51 +0200)
commit61202e4de92d9bf7169dd5f2ef2d6c6e5683ec53
treef254c2cd8b188d663c201a253763425cedd43bdf
parent0f1bfe4e5eb8db9841b57ade1384b9a8ffcd38c3
Bluetooth: Free up l2cap_chan->sport when initiating a connection

The sport variable is used to track the allocation of the local PSM
database to ensure no two sockets take the same local PSM. It is
acquired upon bind() but needs to be freed up if the socket ends up
becoming a client one. This patch adds the clearing of the value when
l2cap_chan_connect is called.

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