Fix: Failed to connect to bnep profile 94/141794/1
authorAnurag Biradar <biradar.a@samsung.com>
Mon, 10 Apr 2017 14:21:01 +0000 (19:51 +0530)
committerAnurag Biradar <biradar.a@samsung.com>
Tue, 1 Aug 2017 11:31:42 +0000 (17:01 +0530)
[Model] Z400F
[BinType] AP
[Customer] All

[Issue#] P170410-04879, P170411-03752
[Request] PLM
[Occurrence Version] QD3

[Problem] Failed to connect to bnep profile
[Cause & Measure] Cause: Session is not getting freed in error
case and because of which ACL is not disconnected. So, further connection
are getting failed even though tethering is enabled in remote device.
Measure: Free session in case of error.

[Checking Method] Steps
1) pair android device and DUT
2) Tap on paired device in BT menu of DUT
3) Observe toast "unable to connect, turn on BT tethering in [device_name]"
4) Turn on BT tethering in android device
5) Tap on paired android device again in BT menu of DUT
6) Observe same toast again

[Solution company] Samsung
[Change Type] Code Change

Change-Id: I73f5161411d157a19f5850e141865574fbdd88ab

profiles/network/connection.c

index 53d35fe..b2aeeb4 100644 (file)
@@ -188,6 +188,14 @@ static void cancel_connection(struct network_conn *nc, int err)
 
        if (nc->state == CONNECTED)
                bnep_disconnect(nc->session);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+       else {
+               /* In error case we need to free session */
+               DBG("Cancel Connection state %d", nc->state);
+               bnep_free(nc->session);
+               nc->session = NULL;
+       }
+#endif
 
 #ifndef TIZEN_FEATURE_BLUEZ_MODIFY
        bnep_free(nc->session);