Diff between 9be5d8018dd1b75cb9cf9d206b389049a0515c74 and 6b544758375c3c68c92cec1e32c83a8ba24e4e59

Changed Files

File Additions Deletions Status
src/advertising.c +10 -1 modified

Full Patch

diff --git a/src/advertising.c b/src/advertising.c
index 7f55a20..b9d923d 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -1259,9 +1259,18 @@ static void add_client_complete(struct btd_adv_client *client, uint8_t status)
 {
 	DBusMessage *reply;
 
-	if (status) {
+	if (status)
 		error("Failed to add advertisement: %s (0x%02x)",
 						mgmt_errstr(status), status);
+
+	/* If the advertising request was not started by a direct call from
+	 * the client, but rather by a refresh due to properties update or
+	 * our internal timer, there is nothing to reply to.
+	 */
+	if (!client->reg)
+		return;
+
+	if (status) {
 		reply = btd_error_failed(client->reg,
 					"Failed to register advertisement");
 		queue_remove(client->manager->clients, client);