Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] client: fix calling ad_unregister
@ 2017-02-14  9:27 Seulki Shin
  2017-02-14 18:19 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 2+ messages in thread
From: Seulki Shin @ 2017-02-14  9:27 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: SeulKi Shin

From: SeulKi Shin <sskcorea@gmail.com>

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@gmail.com>
---
 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


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

end of thread, other threads:[~2017-02-14 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-14  9:27 [PATCH] client: fix calling ad_unregister Seulki Shin
2017-02-14 18:19 ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox