Files
build/patch/kernel/archive/sm8250-6.7/0025-bluetooth-fix-some-blutooth-LE-devices-not-pairing.patch
2023-11-26 23:20:57 +01:00

31 lines
1016 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: amazingfate <liujianfeng1994@gmail.com>
Date: Sun, 5 Nov 2023 12:23:48 +0800
Subject: bluetooth: fix some blutooth LE devices not pairing
---
net/bluetooth/smp.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 5f2f97de2..03b2e9e49 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -2969,8 +2969,11 @@ static int smp_sig_channel(struct l2cap_chan *chan, struct sk_buff *skb)
if (code > SMP_CMD_MAX)
goto drop;
- if (smp && !test_and_clear_bit(code, &smp->allow_cmd))
- goto drop;
+ if (smp && !test_and_clear_bit(code, &smp->allow_cmd)) {
+ bt_dev_warn(hcon->hdev, "test_and_clear_bit failed with command code 0x%2.2x", code);
+ if ((code != SMP_CMD_ENCRYPT_INFO) && (code != SMP_CMD_INITIATOR_IDENT))
+ goto drop;
+ }
/* If we don't have a context the only allowed commands are
* pairing request and security request.
--
Armbian