[PATCH 4/4] android/gatt: Fix updating mtu for no registered app

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

 



Gatt shouldn't notify about updating mtu if no apps are registered.
Without this patch, while connecting crash can occur.
---
 android/gatt.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/android/gatt.c b/android/gatt.c
index 04f89af..157b89d 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -978,6 +978,11 @@ static void notify_mtu_change(void *data, void *user_data)
 	if (conn->device != device)
 		return;
 
+	if (!conn->app) {
+		error("gatt: can't notify mtu - no app registered for conn");
+		return;
+	}
+
 	switch (conn->app->type) {
 	case GATT_CLIENT:
 		notify_client_mtu_change(conn, true);
-- 
2.1.0

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