Files
build/patch/kernel/archive/sm8250-6.6/0027-bluetooth-fix-some-blutooth-LE-devices-not-pairing.patch
Jianfeng Liu 409cd45e50 xiaomi-elish: update config for 6.6, and fix one bluetooth pairing issue (#5885)
* xiaomi-elish: update .config, enable BINFMT_MISC and UHID
* xiaomi-elish: fix some bluetooth LE devices not pairing
2023-11-05 10:04:12 +01:00

31 lines
1022 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 f1a9fc0012f0..62c4f3b56d22 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -2970,8 +2970,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