[PATCH] client: fix calling ad_unregister

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: SeulKi Shin <sskcorea@xxxxxxxxx>

ad_register shall only be called in case the advertise command has been
called so registered flag should be checked before calling
UnregisterAdvertisement.

Signed-off-by: SeulKi Shin <sskcorea@xxxxxxxxx>
---
 client/advertising.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/client/advertising.c b/client/advertising.c
index 62201d5..81fa851 100644
--- a/client/advertising.c
+++ b/client/advertising.c
@@ -317,6 +317,9 @@ void ad_unregister(DBusConnection *conn, GDBusProxy *manager)
 	if (!manager)
 		ad_release(conn);
 
+	if (!registered)
+		return;
+
 	if (g_dbus_proxy_method_call(manager, "UnregisterAdvertisement",
 					unregister_setup, unregister_reply,
 					conn, NULL) == FALSE) {
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux