diff --git a/android/gatt.c b/android/gatt.c
index c3dc41c..5d01d8b 100644
--- a/android/gatt.c
+++ b/android/gatt.c
dev = find_device_by_addr(bdaddr);
if (!dev) {
error("gatt: send_gatt_response, could not find dev");
- goto done;
+ return;
}
entry = queue_find(dev->pending_requests, match_dev_request_by_handle,
entry->error = status;
if (!len)
- goto done;
+ return;
entry->value = malloc0(len);
if (!entry->value) {
entry->error = ATT_ECODE_INSUFF_RESOURCES;
- goto done;
+ return;
}
memcpy(entry->value, data, len);
-
-done:
- send_dev_complete_response(dev, opcode);
}
static struct pending_trans_data *conn_add_transact(struct app_connection *conn,
send_gatt_response(transaction->opcode, handle, cmd->offset,
cmd->status, cmd->len, cmd->data,
&conn->device->bdaddr);
+ send_dev_complete_response(conn->device, transaction->opcode);
done:
/* Clean request data */