From 348276044f95d697b4ff81aafe5d673d6afecf9d Mon Sep 17 00:00:00 2001 From: Arkadiusz Lichwa Date: Tue, 15 Sep 2015 11:21:44 +0200 Subject: [PATCH] Bluetooth: ATT: Fix write check permission Writes to GATT attribute that has no write permission set, should return write not permitted (BT_ATT_ERR_WRITE_NOT_PERMITTED) in check permission routine. Change-Id: I95f0988e171294cd98b79d3e7b518383ac47567d Signed-off-by: Arkadiusz Lichwa --- net/bluetooth/att.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/att.c b/net/bluetooth/att.c index ecaef682e2a..babd2da97ce 100644 --- a/net/bluetooth/att.c +++ b/net/bluetooth/att.c @@ -634,7 +634,7 @@ static uint8_t check_perm(struct bt_conn *conn, const struct bt_gatt_attr *attr, } if ((mask & BT_GATT_PERM_WRITE) && !(attr->perm & BT_GATT_PERM_WRITE)) { - return BT_ATT_ERR_READ_NOT_PERMITTED; + return BT_ATT_ERR_WRITE_NOT_PERMITTED; } mask &= attr->perm;