diff mbox series

[BlueZ,v1] core: add NULL check to adapter_service_remove()

Message ID 20240628103050.535719-1-r.smirnov@omp.ru
State Superseded
Headers show
Series [BlueZ,v1] core: add NULL check to adapter_service_remove() | expand

Commit Message

Roman Smirnov June 28, 2024, 10:30 a.m. UTC
Make adapter_service_remove() safe for passing NULL pointers.
---
 src/adapter.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

bluez.test.bot@gmail.com June 28, 2024, 12:04 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=866524

---Test result---

Test Summary:
CheckPatch                    PASS      0.38 seconds
GitLint                       PASS      0.28 seconds
BuildEll                      PASS      25.08 seconds
BluezMake                     PASS      1699.29 seconds
MakeCheck                     PASS      13.10 seconds
MakeDistcheck                 PASS      178.40 seconds
CheckValgrind                 PASS      252.27 seconds
CheckSmatch                   PASS      355.14 seconds
bluezmakeextell               PASS      119.98 seconds
IncrementalBuild              PASS      1455.52 seconds
ScanBuild                     PASS      1015.46 seconds



---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org June 28, 2024, 3:10 p.m. UTC | #2
Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri, 28 Jun 2024 13:30:49 +0300 you wrote:
> Make adapter_service_remove() safe for passing NULL pointers.
> ---
>  src/adapter.c | 4 ++++
>  1 file changed, 4 insertions(+)

Here is the summary with links:
  - [BlueZ,v1] core: add NULL check to adapter_service_remove()
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ee12a631caef

You are awesome, thank you!
diff mbox series

Patch

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.