Skip to contentSkip to conversation

client: fix calling ad_unregister

PATCH Applied Seulki Shin 2 participants 2 messages Feb 14, 2017 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 client: fix calling ad_unregister

From: SeulKi Shin <[email protected]>

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

---
 client/advertising.c | 3 +++
 1 file changed, 3 insertions(+)
client/advertising.c +3 -0
index 62201d5..81fa851 100644
@@ -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) {
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw

Hi,

Quoted 7 lines · Seulki Shin

From: SeulKi Shin <[email protected]>

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

We don't use Signed-off-by line in userspace.

Quoted 19 lines
---
 client/advertising.c | 3 +++
 1 file changed, 3 insertions(+)
client/advertising.c +3 -1
index 62201d5..81fa851 100644
@@ -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) {
--
Quoted 1 line

2.7.4

Applied, thanks.

Signature · 1 line
Luiz Augusto von Dentz