Diff between 9c8538c1711e9e3e9db440e145dac0e71bb7158a and 5c41f6bb54cf1c881931b5631c55c720cf86ecb4

Changed Files

File Additions Deletions Status
src/gatt-client.c +6 -0 modified

Full Patch

diff --git a/src/gatt-client.c b/src/gatt-client.c
index 20c3fbe..c706307 100644
--- a/src/gatt-client.c
+++ b/src/gatt-client.c
@@ -1545,6 +1545,12 @@ static DBusMessage *characteristic_start_notify(DBusConnection *conn,
 	const char *sender = dbus_message_get_sender(msg);
 	struct async_dbus_op *op;
 	struct notify_client *client;
+	struct btd_device *device = chrc->service->client->device;
+
+	if (device_is_disconnecting(device)) {
+		error("Device is disconnecting. StartNotify is not allowed.");
+		return btd_error_not_connected(msg);
+	}
 
 	if (chrc->notify_io)
 		return btd_error_not_permitted(msg, "Notify acquired");