From 366ddedeb619df5209e97abb7ccac04744115c05 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Wed, 14 Dec 2022 22:03:39 +0100 Subject: [PATCH] Bluetooth: Host: Fix issue with setting 0/NULL data for PA bt_le_per_adv_set_data would not accept the ad to be NULL or the ad_len to be 0, making it impossible to set no data (which effectively clears existing data). Signed-off-by: Emil Gydesen --- subsys/bluetooth/host/adv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c index 2075d58249f..7901baf78af 100644 --- a/subsys/bluetooth/host/adv.c +++ b/subsys/bluetooth/host/adv.c @@ -1810,7 +1810,7 @@ int bt_le_per_adv_set_data(const struct bt_le_ext_adv *adv, return -EINVAL; } - if (!ad_len || !ad) { + if (ad_len != 0 && ad == NULL) { return -EINVAL; }