diff mbox series

[BlueZ] hciemu: fix accessing wrong/uninitialized variables

Message ID 1ac4f119e79c10da2da2d41f9458daaf170d466f.1745860619.git.pav@iki.fi
State New
Headers show
Series [BlueZ] hciemu: fix accessing wrong/uninitialized variables | expand

Commit Message

Pauli Virtanen April 28, 2025, 5:18 p.m. UTC
Fixes: aeeb4fd64adf ("hciemu: set bthost ACL MTU to match btdev")
Fixes: a112d4345771 ("bthost: implement fragmenting to ACL MTU")
---
 emulator/btdev.c  | 2 +-
 emulator/bthost.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/emulator/btdev.c b/emulator/btdev.c
index cf5c36bb4..7bb40670c 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -7466,7 +7466,7 @@  void btdev_get_mtu(struct btdev *btdev, uint16_t *acl, uint16_t *sco,
 	if (acl)
 		*acl = btdev->acl_mtu;
 	if (sco)
-		*acl = btdev->sco_mtu;
+		*sco = btdev->sco_mtu;
 	if (iso)
 		*iso = btdev->iso_mtu;
 }
diff --git a/emulator/bthost.c b/emulator/bthost.c
index 214583cc5..f53b4382d 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -688,7 +688,7 @@  static void send_iov(struct bthost *bthost, uint16_t handle, uint16_t cid,
 
 	/* Fragment to ACL MTU */
 
-	payload_mtu = bthost->acl_mtu - pdu[0].iov_len - pdu[1].iov_len;
+	payload_mtu = bthost->acl_mtu - sizeof(pkt) - sizeof(acl_hdr);
 
 	flag = 0x00;
 	do {