diff options
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 37706e89af50..944c4fc87905 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -3351,6 +3351,8 @@ static int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status) | |||
3351 | 3351 | ||
3352 | static void start_discovery_complete(struct hci_dev *hdev, u8 status) | 3352 | static void start_discovery_complete(struct hci_dev *hdev, u8 status) |
3353 | { | 3353 | { |
3354 | unsigned long timeout = 0; | ||
3355 | |||
3354 | BT_DBG("status %d", status); | 3356 | BT_DBG("status %d", status); |
3355 | 3357 | ||
3356 | if (status) { | 3358 | if (status) { |
@@ -3366,13 +3368,11 @@ static void start_discovery_complete(struct hci_dev *hdev, u8 status) | |||
3366 | 3368 | ||
3367 | switch (hdev->discovery.type) { | 3369 | switch (hdev->discovery.type) { |
3368 | case DISCOV_TYPE_LE: | 3370 | case DISCOV_TYPE_LE: |
3369 | queue_delayed_work(hdev->workqueue, &hdev->le_scan_disable, | 3371 | timeout = DISCOV_LE_TIMEOUT; |
3370 | DISCOV_LE_TIMEOUT); | ||
3371 | break; | 3372 | break; |
3372 | 3373 | ||
3373 | case DISCOV_TYPE_INTERLEAVED: | 3374 | case DISCOV_TYPE_INTERLEAVED: |
3374 | queue_delayed_work(hdev->workqueue, &hdev->le_scan_disable, | 3375 | timeout = msecs_to_jiffies(DISCOV_INTERLEAVED_TIMEOUT); |
3375 | DISCOV_INTERLEAVED_TIMEOUT); | ||
3376 | break; | 3376 | break; |
3377 | 3377 | ||
3378 | case DISCOV_TYPE_BREDR: | 3378 | case DISCOV_TYPE_BREDR: |
@@ -3381,6 +3381,11 @@ static void start_discovery_complete(struct hci_dev *hdev, u8 status) | |||
3381 | default: | 3381 | default: |
3382 | BT_ERR("Invalid discovery type %d", hdev->discovery.type); | 3382 | BT_ERR("Invalid discovery type %d", hdev->discovery.type); |
3383 | } | 3383 | } |
3384 | |||
3385 | if (!timeout) | ||
3386 | return; | ||
3387 | |||
3388 | queue_delayed_work(hdev->workqueue, &hdev->le_scan_disable, timeout); | ||
3384 | } | 3389 | } |
3385 | 3390 | ||
3386 | static int start_discovery(struct sock *sk, struct hci_dev *hdev, | 3391 | static int start_discovery(struct sock *sk, struct hci_dev *hdev, |