From d3971990d9268afd3628996876c756bf15849c56 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 25 Jan 2024 15:27:18 -0500 Subject: [PATCH] bap: Fix crash when attempting to set device as connectable Broadcast source endpoints don't have a device object. --- profiles/audio/bap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 864761dfd..007e19f21 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -1390,7 +1390,8 @@ static bool pac_found_bcast(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, } /* Mark the device as connetable if an Endpoint is registered */ - btd_device_set_connectable(data->device, true); + if (data->device) + btd_device_set_connectable(data->device, true); return true; } -- 2.47.3