From 496e962769b589980499a35e1b6a21a586b3048c Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 6 Nov 2014 17:59:38 +0200 Subject: android/gatt: Fix maybe uninitialized warning --- android/gatt.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/android/gatt.c b/android/gatt.c index 467182eb1..8b6810c71 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -4985,14 +4985,16 @@ static void handle_server_add_characteristic(const void *buf, uint16_t len) cmd->properties, read_cb, write_cb, INT_TO_PTR(app_id)); - if (!attrib) + if (!attrib) { status = HAL_STATUS_FAILED; - else - status = HAL_STATUS_SUCCESS; + goto failed; + } + + ev.char_handle = gatt_db_attribute_get_handle(attrib); + status = HAL_STATUS_SUCCESS; failed: ev.srvc_handle = cmd->service_handle; - ev.char_handle = gatt_db_attribute_get_handle(attrib); ev.status = status; ev.server_if = app_id; ev.status = status == HAL_STATUS_SUCCESS ? GATT_SUCCESS : GATT_FAILURE; -- cgit v1.2.1