• Johan Hedberg's avatar
    Bluetooth: Fix trying to disable scanning twice · 317ac8cb
    Johan Hedberg authored
    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: default avatarJohan Hedberg <johan.hedberg@intel.com>
    Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
    317ac8cb
hci_conn.c 29.4 KB