Diff between 8ebb0ff1178591e49b1a6f340c8b1f846824fa54 and 5bbefdcc9d2254b5a193c9361a44257d69e11246

Changed Files

File Additions Deletions Status
src/shared/att.c +5 -5 modified

Full Patch

diff --git a/src/shared/att.c b/src/shared/att.c
index 8657cb6..14d346c 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
@@ -727,6 +727,11 @@ static bool bt_att_chan_set_security(struct bt_att_chan *chan, int level)
 {
 	struct bt_security sec;
 
+	if (chan->type == BT_ATT_LOCAL) {
+		chan->sec_level = level;
+		return true;
+	}
+
 	/* Check if security level has already been set, if the security level
 	 * is higher it shall satisfy the request since we never want to
 	 * downgrade security.
@@ -734,11 +739,6 @@ static bool bt_att_chan_set_security(struct bt_att_chan *chan, int level)
 	if (level <= bt_att_chan_get_security(chan))
 		return true;
 
-	if (chan->type == BT_ATT_LOCAL) {
-		chan->sec_level = level;
-		return true;
-	}
-
 	memset(&sec, 0, sizeof(sec));
 	sec.level = level;