From 897025255d622d8f20381021fbd3c2c86b34d9c8 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Mon, 14 Jul 2014 13:52:41 +0200 Subject: [PATCH] android/gatt: Fix signed write on encrypted link This fix invalid setting of res instead of status in error case. --- android/gatt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/android/gatt.c b/android/gatt.c index 8007dc5cc..f42a6f310 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -3061,12 +3061,12 @@ static void handle_client_write_characteristic(const void *buf, uint16_t len) case GATT_WRITE_TYPE_SIGNED: if (get_sec_level(conn->device) != BT_SECURITY_LOW) { error("gatt: Cannot write signed on encrypted link"); - res = HAL_STATUS_FAILED; - } else { - res = signed_write_cmd(conn->device, - ch->ch.value_handle, - cmd->value, cmd->len); + status = HAL_STATUS_FAILED; + goto failed; } + + res = signed_write_cmd(conn->device, ch->ch.value_handle, + cmd->value, cmd->len); break; default: error("gatt: Write type %d unsupported", cmd->write_type); -- 2.47.3