Hi Jakub, On Tuesday 27 of May 2014 12:15:33 Jakub Tyszkowski wrote: > This fixes the missleading error on crypto setup failure: > > 02-17 20:19:44.639 I/bluetoothd( 1705): bluetoothd[1706]: gatt: Failed > to allocate memory for queues > --- > android/gatt.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/android/gatt.c b/android/gatt.c > index dab9781..a8f072f 100644 > --- a/android/gatt.c > +++ b/android/gatt.c > @@ -5491,15 +5491,20 @@ bool bt_gatt_register(struct ipc *ipc, const > bdaddr_t *addr) if (!start_listening_io()) > return false; > > + crypto = bt_crypto_new(); > + if (!crypto) { > + error("gatt: Failed to setup crypto."); listening_io should be cleaned up here. Also no need for dot at the end of error message. > + return false; > + } > + > gatt_devices = queue_new(); > gatt_apps = queue_new(); > app_connections = queue_new(); > listen_apps = queue_new(); > gatt_db = gatt_db_new(); > - crypto = bt_crypto_new(); > > - if (!gatt_devices || !gatt_apps || !listen_apps || > - !app_connections || !gatt_db || !crypto) { > + if (!gatt_devices || !gatt_apps || !listen_apps || !app_connections || > + !gatt_db) { > error("gatt: Failed to allocate memory for queues"); > > queue_destroy(gatt_apps, NULL); -- BR Szymon Janc -- 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