All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v0 1/2] cyclingspeed: Fix D-Bus registration error case
@ 2013-05-29 12:38 Mikel Astiz
  2013-05-29 12:38 ` [PATCH BlueZ v0 2/2] heartrate: " Mikel Astiz
  2013-05-29 13:02 ` [PATCH BlueZ v0 1/2] cyclingspeed: " Johan Hedberg
  0 siblings, 2 replies; 3+ messages in thread
From: Mikel Astiz @ 2013-05-29 12:38 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Mikel Astiz

From: Mikel Astiz <mikel.astiz@bmw-carit.de>

If g_dbus_register_interface() fails, the struct csc_adapter memory will
be freed and therefore the csc_adapters list cannot contain such an
invalid pointer.
---
 profiles/cyclingspeed/cyclingspeed.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/profiles/cyclingspeed/cyclingspeed.c b/profiles/cyclingspeed/cyclingspeed.c
index 76be234..ea6076c 100644
--- a/profiles/cyclingspeed/cyclingspeed.c
+++ b/profiles/cyclingspeed/cyclingspeed.c
@@ -964,8 +964,6 @@ static int csc_adapter_probe(struct btd_profile *p, struct btd_adapter *adapter)
 	cadapter = g_new0(struct csc_adapter, 1);
 	cadapter->adapter = adapter;
 
-	csc_adapters = g_slist_prepend(csc_adapters, cadapter);
-
 	if (!g_dbus_register_interface(btd_get_dbus_connection(),
 						adapter_get_path(adapter),
 						CYCLINGSPEED_MANAGER_INTERFACE,
@@ -978,6 +976,8 @@ static int csc_adapter_probe(struct btd_profile *p, struct btd_adapter *adapter)
 		return -EIO;
 	}
 
+	csc_adapters = g_slist_prepend(csc_adapters, cadapter);
+
 	return 0;
 }
 
-- 
1.8.1.4


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

* [PATCH BlueZ v0 2/2] heartrate: Fix D-Bus registration error case
  2013-05-29 12:38 [PATCH BlueZ v0 1/2] cyclingspeed: Fix D-Bus registration error case Mikel Astiz
@ 2013-05-29 12:38 ` Mikel Astiz
  2013-05-29 13:02 ` [PATCH BlueZ v0 1/2] cyclingspeed: " Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Mikel Astiz @ 2013-05-29 12:38 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Mikel Astiz

From: Mikel Astiz <mikel.astiz@bmw-carit.de>

If g_dbus_register_interface() fails, the struct heartrate_adapter
memory will be freed and therefore the heartrate_adapters list cannot
contain such an invalid pointer.
---
 profiles/heartrate/heartrate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/profiles/heartrate/heartrate.c b/profiles/heartrate/heartrate.c
index 8de81bb..34ec9bc 100644
--- a/profiles/heartrate/heartrate.c
+++ b/profiles/heartrate/heartrate.c
@@ -730,8 +730,6 @@ static int heartrate_adapter_register(struct btd_adapter *adapter)
 	hradapter = g_new0(struct heartrate_adapter, 1);
 	hradapter->adapter = adapter;
 
-	heartrate_adapters = g_slist_prepend(heartrate_adapters, hradapter);
-
 	if (!g_dbus_register_interface(btd_get_dbus_connection(),
 						adapter_get_path(adapter),
 						HEART_RATE_MANAGER_INTERFACE,
@@ -744,6 +742,8 @@ static int heartrate_adapter_register(struct btd_adapter *adapter)
 		return -EIO;
 	}
 
+	heartrate_adapters = g_slist_prepend(heartrate_adapters, hradapter);
+
 	return 0;
 }
 
-- 
1.8.1.4


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

* Re: [PATCH BlueZ v0 1/2] cyclingspeed: Fix D-Bus registration error case
  2013-05-29 12:38 [PATCH BlueZ v0 1/2] cyclingspeed: Fix D-Bus registration error case Mikel Astiz
  2013-05-29 12:38 ` [PATCH BlueZ v0 2/2] heartrate: " Mikel Astiz
@ 2013-05-29 13:02 ` Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2013-05-29 13:02 UTC (permalink / raw)
  To: Mikel Astiz; +Cc: linux-bluetooth, Mikel Astiz

Hi Mikel,

On Wed, May 29, 2013, Mikel Astiz wrote:
> If g_dbus_register_interface() fails, the struct csc_adapter memory will
> be freed and therefore the csc_adapters list cannot contain such an
> invalid pointer.
> ---
>  profiles/cyclingspeed/cyclingspeed.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Both patches have been applied. Thanks.

Johan

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

end of thread, other threads:[~2013-05-29 13:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-29 12:38 [PATCH BlueZ v0 1/2] cyclingspeed: Fix D-Bus registration error case Mikel Astiz
2013-05-29 12:38 ` [PATCH BlueZ v0 2/2] heartrate: " Mikel Astiz
2013-05-29 13:02 ` [PATCH BlueZ v0 1/2] cyclingspeed: " Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.