diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-11-06 17:59:38 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2014-11-06 17:59:38 +0200 |
commit | 496e962769b589980499a35e1b6a21a586b3048c (patch) | |
tree | 7f6f84fb5791cfdc62ef2fd95b14133835b59366 | |
parent | 441ebd51933dc108b15069cc70e3e359b9cf054f (diff) | |
download | bluez-496e962769b589980499a35e1b6a21a586b3048c.tar.gz |
android/gatt: Fix maybe uninitialized warning
-rw-r--r-- | android/gatt.c | 10 |
1 files 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; |