]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: Fix trying to disable scanning twice
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 28 Feb 2014 18:26:12 +0000 (20:26 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 28 Feb 2014 18:28:16 +0000 (10:28 -0800)
commitab16cede6746f2c3e76db95c9f4e1615342a0e20
treef94c7db069a87514a4b5e16cff1dafbbd5981dd7
parent594adf87b17dd17ebbee862f337fe95b679c0b2d
Bluetooth: Fix trying to disable scanning twice

The discovery process has a timer for disabling scanning, however
scanning might be disabled through other means too like the auto-connect
process.  We should therefore ensure that the timer is never active
after sending a HCI command to disable scanning.

There was some existing code in stop_scan_complete trying to avoid the
timer when a connect request interrupts a discovery procedure, but the
other way around was not covered. This patch covers both scenarios by
canceling the timer as soon as we get a successful command complete for
the disabling HCI command.

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