linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH_v4 1/7] android/pan: Free device after sending diconnected notification
@ 2013-12-18 14:53 Ravi kumar Veeramally
  2013-12-18 14:53 ` [PATCH_v4 2/7] android/pan: Change local_role to NONE only when device list is empty Ravi kumar Veeramally
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Ravi kumar Veeramally @ 2013-12-18 14:53 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ravi kumar Veeramally

---
 android/pan.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/android/pan.c b/android/pan.c
index e410f54..2bbba9e 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -103,6 +103,8 @@ static void bt_pan_notify_conn_state(struct pan_device *dev, uint8_t state)
 
 	ipc_send_notif(HAL_SERVICE_ID_PAN, HAL_EV_PAN_CONN_STATE, sizeof(ev),
 									&ev);
+	if (dev->conn_state == HAL_PAN_STATE_DISCONNECTED)
+		pan_device_free(dev);
 }
 
 static void bt_pan_notify_ctrl_state(struct pan_device *dev, uint8_t state)
@@ -131,7 +133,6 @@ static gboolean bnep_watchdog_cb(GIOChannel *chan, GIOCondition cond,
 	bnep_if_down(dev->iface);
 	bnep_conndel(&dev->dst);
 	bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED);
-	pan_device_free(dev);
 
 	return FALSE;
 }
@@ -146,7 +147,6 @@ static void bnep_conn_cb(GIOChannel *chan, char *iface, int err, void *data)
 		error("bnep connect req failed: %s", strerror(-err));
 		bnep_conndel(&dev->dst);
 		bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED);
-		pan_device_free(dev);
 		return;
 	}
 
@@ -190,7 +190,6 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer data)
 
 fail:
 	bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED);
-	pan_device_free(dev);
 }
 
 static void bt_pan_connect(const void *buf, uint16_t len)
@@ -284,7 +283,6 @@ static void bt_pan_disconnect(const void *buf, uint16_t len)
 	}
 
 	dev = l->data;
-
 	if (dev->watch) {
 		g_source_remove(dev->watch);
 		dev->watch = 0;
@@ -292,10 +290,7 @@ static void bt_pan_disconnect(const void *buf, uint16_t len)
 
 	bnep_if_down(dev->iface);
 	bnep_conndel(&dst);
-
 	bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED);
-	pan_device_free(dev);
-
 	status = HAL_STATUS_SUCCESS;
 
 failed:
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-12-19  8:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-18 14:53 [PATCH_v4 1/7] android/pan: Free device after sending diconnected notification Ravi kumar Veeramally
2013-12-18 14:53 ` [PATCH_v4 2/7] android/pan: Change local_role to NONE only when device list is empty Ravi kumar Veeramally
2013-12-18 14:53 ` [PATCH_v4 3/7] android/pan: shutdown io channel on disconnect call Ravi kumar Veeramally
2013-12-19  8:14   ` Johan Hedberg
2013-12-19  8:48     ` Ravi kumar Veeramally
2013-12-18 14:53 ` [PATCH_v4 4/7] bnep: Rename struct bnep_conn to struct bnep for better readability Ravi kumar Veeramally
2013-12-18 14:53 ` [PATCH_v4 5/7] bnep: Add bnep_new and bnep_free api's Ravi kumar Veeramally
2013-12-18 14:53 ` [PATCH_v4 6/7] bnep: Refactored bnep connect and disconnect calls Ravi kumar Veeramally
2013-12-18 14:53 ` [PATCH_v4 7/7] bnep: Refactored bnep server apis for bridge addition and deletion Ravi kumar Veeramally

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).