summaryrefslogtreecommitdiff
path: root/android/gatt.c
diff options
context:
space:
mode:
authorGrzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>2015-04-29 11:15:53 +0200
committerSzymon Janc <szymon.janc@tieto.com>2015-05-08 14:54:05 +0200
commit67eccade2d38f790b0698b6e2cbcd6282b21e534 (patch)
tree3e87538baf250af496aafa09c6edef01c68ca844 /android/gatt.c
parent6a44a69acead3e0d5a5bf5879f7ae312d419e022 (diff)
downloadbluez-67eccade2d38f790b0698b6e2cbcd6282b21e534.tar.gz
android/gatt: Fix updating mtu for no registered app
Gatt shouldn't notify about updating mtu if no apps are registered. Without this patch, while connecting crash can occur.
Diffstat (limited to 'android/gatt.c')
-rw-r--r--android/gatt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/android/gatt.c b/android/gatt.c
index 625b7dfbf..b8074a937 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);