Skip to content

Commit b37cab5

Browse files
committed
Bluetooth: ISO: Don't reject BT_ISO_QOS if parameters are unset
Consider certain values (0x00) as unset and load proper default if an application has not set them properly. Fixes: 0fe8c8d ("Bluetooth: Split bt_iso_qos into dedicated structures") Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 19fa4f2 commit b37cab5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

net/bluetooth/iso.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,8 +1451,8 @@ static bool check_ucast_qos(struct bt_iso_qos *qos)
14511451

14521452
static bool check_bcast_qos(struct bt_iso_qos *qos)
14531453
{
1454-
if (qos->bcast.sync_factor == 0x00)
1455-
return false;
1454+
if (!qos->bcast.sync_factor)
1455+
qos->bcast.sync_factor = 0x01;
14561456

14571457
if (qos->bcast.packing > 0x01)
14581458
return false;
@@ -1475,6 +1475,9 @@ static bool check_bcast_qos(struct bt_iso_qos *qos)
14751475
if (qos->bcast.skip > 0x01f3)
14761476
return false;
14771477

1478+
if (!qos->bcast.sync_timeout)
1479+
qos->bcast.sync_timeout = BT_ISO_SYNC_TIMEOUT;
1480+
14781481
if (qos->bcast.sync_timeout < 0x000a || qos->bcast.sync_timeout > 0x4000)
14791482
return false;
14801483

@@ -1484,6 +1487,9 @@ static bool check_bcast_qos(struct bt_iso_qos *qos)
14841487
if (qos->bcast.mse > 0x1f)
14851488
return false;
14861489

1490+
if (!qos->bcast.timeout)
1491+
qos->bcast.sync_timeout = BT_ISO_SYNC_TIMEOUT;
1492+
14871493
if (qos->bcast.timeout < 0x000a || qos->bcast.timeout > 0x4000)
14881494
return false;
14891495

0 commit comments

Comments
 (0)