From: Hemant Gupta Date: Thu, 5 Apr 2012 04:57:21 +0000 (+0530) Subject: Bluetooth: Fix clearing discovery type when stopping discovery X-Git-Tag: next-20120411~42^2~5 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=74dc81a299b92dee2adbf2a6fa02b575f92e2b39;p=karo-tx-linux.git Bluetooth: Fix clearing discovery type when stopping discovery This patch prevents resetting of discovery type while stopping discovery, since otherwise the wrong type might be send in case of discovery failure. It also doesn't matter that we are "lazy" with updating the type since it is anyway reset when starting discovery again and it's not needed to know the current discovery state. Signed-off-by: Hemant Gupta Signed-off-by: Johan Hedberg --- diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 286f3fcce635..9629645bec64 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -386,7 +386,6 @@ void hci_discovery_set_state(struct hci_dev *hdev, int state) case DISCOVERY_STOPPED: if (hdev->discovery.state != DISCOVERY_STARTING) mgmt_discovering(hdev, 0); - hdev->discovery.type = 0; break; case DISCOVERY_STARTING: break;