Make adapter_service_remove() safe for passing NULL pointers. --- src/adapter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index bdc5bf920..57e4dcd54 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1349,6 +1349,10 @@ int adapter_service_add(struct btd_adapter *adapter, sdp_record_t *rec) void adapter_service_remove(struct btd_adapter *adapter, uint32_t handle) { sdp_record_t *rec; + + if (!adapter) + return; + /* * If the controller does not support BR/EDR operation, * there is no point in trying to remote SDP records. -- 2.43.0