Thread (2 messages) flat view 2 messages, 2 authors, 2017-02-14
STALE3459d

[PATCH] client: fix calling ad_unregister

From: Seulki Shin <hidden>
Date: 2017-02-14 09:27:50
Subsystem: the rest · Maintainer: Linus Torvalds

From: SeulKi Shin <redacted>

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help