All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hfp_hf_bluez5: Fix crash on repairing a Device.
@ 2015-07-10 15:08 Kuba Pawlak
  2015-07-13  2:19 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Kuba Pawlak @ 2015-07-10 15:08 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1393 bytes --]

It may happen that a Device object is unpaired an paired again
without being removed from DBus. This in turn triggers second
modem object to be created, but not fully initialized.
If this modem object is used, oFono will crash.
---
 plugins/hfp_hf_bluez5.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index 5ee70c5..713c789 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -738,8 +738,17 @@ static void modem_register_from_proxy(GDBusProxy *proxy, const char *path)
 		return;
 
 	dbus_message_iter_get_basic(&iter, &paired);
-	if (paired == FALSE)
+
+	if (paired == FALSE) {
+		modem = ofono_modem_find(device_path_compare, (void *) path);
+
+		if (modem != NULL) {
+			ofono_modem_remove(modem);
+			g_dbus_proxy_set_removed_watch(proxy, NULL, NULL);
+			g_dbus_proxy_set_property_watch(proxy, NULL, NULL);
+		}
 		return;
+	}
 
 	if (g_dbus_proxy_get_property(proxy, "UUIDs", &iter) == FALSE)
 		return;
-- 
1.7.11.7

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Prof. Dr. Hermann Eul
Chairperson of the Supervisory Board: Tiffany Doon Silva
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


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

* Re: [PATCH] hfp_hf_bluez5: Fix crash on repairing a Device.
  2015-07-10 15:08 [PATCH] hfp_hf_bluez5: Fix crash on repairing a Device Kuba Pawlak
@ 2015-07-13  2:19 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2015-07-13  2:19 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 447 bytes --]

Hi Kuba,

On 07/10/2015 10:08 AM, Kuba Pawlak wrote:
> It may happen that a Device object is unpaired an paired again
> without being removed from DBus. This in turn triggers second
> modem object to be created, but not fully initialized.
> If this modem object is used, oFono will crash.
> ---
>   plugins/hfp_hf_bluez5.c | 11 ++++++++++-
>   1 file changed, 10 insertions(+), 1 deletion(-)
>

Applied, thanks.

Regards,
-Denis


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

end of thread, other threads:[~2015-07-13  2:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-10 15:08 [PATCH] hfp_hf_bluez5: Fix crash on repairing a Device Kuba Pawlak
2015-07-13  2:19 ` Denis Kenzior

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.