summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/eir.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-08-18 14:19:27 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-08-24 12:22:05 -0700
commitdb08722fc7d46168fe31d9b8a7b29229dd959f9f (patch)
treeb4aa9f8dd1a71e4c93caab34bcd78b8092490e8b /net/bluetooth/eir.c
parentfbdc4bc47268953c80853489f696e02d61f9a2c6 (diff)
downloadlinux-stable-db08722fc7d46168fe31d9b8a7b29229dd959f9f.tar.gz
linux-stable-db08722fc7d46168fe31d9b8a7b29229dd959f9f.tar.bz2
linux-stable-db08722fc7d46168fe31d9b8a7b29229dd959f9f.zip
Bluetooth: hci_core: Fix missing instances using HCI_MAX_AD_LENGTH
There a few instances still using HCI_MAX_AD_LENGTH instead of using max_adv_len which takes care of detecting what is the actual maximum length depending on if the controller supports EA or not. Fixes: 112b5090c219 ("Bluetooth: MGMT: Fix always using HCI_MAX_AD_LENGTH") Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'net/bluetooth/eir.c')
-rw-r--r--net/bluetooth/eir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/eir.c b/net/bluetooth/eir.c
index 8a85f6cdfbc1..9214189279e8 100644
--- a/net/bluetooth/eir.c
+++ b/net/bluetooth/eir.c
@@ -33,7 +33,7 @@ u8 eir_append_local_name(struct hci_dev *hdev, u8 *ptr, u8 ad_len)
size_t complete_len;
/* no space left for name (+ NULL + type + len) */
- if ((HCI_MAX_AD_LENGTH - ad_len) < HCI_MAX_SHORT_NAME_LENGTH + 3)
+ if ((max_adv_len(hdev) - ad_len) < HCI_MAX_SHORT_NAME_LENGTH + 3)
return ad_len;
/* use complete name if present and fits */