linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] audio: Move btd_device unref after last use in device_free
@ 2012-10-16 10:12 Szymon Janc
  2012-10-16 10:12 ` [PATCH 2/8] mgmt: Make mgmt_update_powered return void Szymon Janc
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Szymon Janc @ 2012-10-16 10:12 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

btd_device should not be used after local reference was dropped.

---
 audio/device.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/audio/device.c b/audio/device.c
index 175e3c0..be63031 100644
--- a/audio/device.c
+++ b/audio/device.c
@@ -98,8 +98,6 @@ static void device_free(struct audio_device *dev)
 {
 	struct dev_priv *priv = dev->priv;
 
-	btd_device_unref(dev->btd_dev);
-
 	if (priv) {
 		if (priv->control_timer)
 			g_source_remove(priv->control_timer);
@@ -117,6 +115,8 @@ static void device_free(struct audio_device *dev)
 		g_free(priv);
 	}
 
+	btd_device_unref(dev->btd_dev);
+
 	g_free(dev->path);
 	g_free(dev);
 }
-- 
1.7.9.5


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

end of thread, other threads:[~2012-10-16 10:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-16 10:12 [PATCH 1/8] audio: Move btd_device unref after last use in device_free Szymon Janc
2012-10-16 10:12 ` [PATCH 2/8] mgmt: Make mgmt_update_powered return void Szymon Janc
2012-10-16 10:12 ` [PATCH 3/8] audio: Remove path from struct audio_device Szymon Janc
2012-10-16 10:12 ` [PATCH 4/8] network: Remove redundant struct network_peer members Szymon Janc
2012-10-16 10:12 ` [PATCH 5/8] input: Remove not needed adapters list in manager Szymon Janc
2012-10-16 10:12 ` [PATCH 6/8] mgmt: Remove not used members from controller_info Szymon Janc
2012-10-16 10:12 ` [PATCH 7/8] Simplify str2ba function Szymon Janc
2012-10-16 10:12 ` [PATCH 8/8] adapter: Remove not used defines Szymon Janc
2012-10-16 10:37 ` [PATCH 1/8] audio: Move btd_device unref after last use in device_free Johan Hedberg

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).