[PATCH BlueZ 2/8] tools/btpclient: Initial check of ad_proxy presence in stop adv cmd

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

 



This patch covers with fail response if no advertising proxy was
registered at command beginning.
---
 tools/btpclient.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/tools/btpclient.c b/tools/btpclient.c
index 33116ce1b..f2c79b3a3 100644
--- a/tools/btpclient.c
+++ b/tools/btpclient.c
@@ -1156,19 +1156,15 @@ static void btp_gap_stop_advertising(uint8_t index, const void *param,
 	}
 
 	if (!l_dbus_proxy_get_property(adapter->proxy, "Powered", "b", &prop) ||
-							!prop || !ad.registered)
+				!prop || !adapter->ad_proxy || !ad.registered)
 		goto failed;
 
-	if (adapter->ad_proxy) {
-		if (!l_dbus_proxy_method_call(adapter->ad_proxy,
+	if (!l_dbus_proxy_method_call(adapter->ad_proxy,
 						"UnregisterAdvertisement",
 						unreg_advertising_setup,
 						stop_advertising_reply,
-						NULL, NULL)) {
-			status = BTP_ERROR_FAIL;
-			goto failed;
-		}
-	}
+						NULL, NULL))
+		goto failed;
 
 	return;
 
-- 
2.13.6

--
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