diff mbox series

[BlueZ,1/2] adapter: Fix adding SDP records when operating on LE only mode

Message ID 20220324213658.59479-1-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 4fefa24097e45153f99cabbc70534d69a2a35ecd
Headers show
Series [BlueZ,1/2] adapter: Fix adding SDP records when operating on LE only mode | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS
tedd_an/setupell success Setup ELL PASS
tedd_an/buildprep success Build Prep PASS
tedd_an/build success Build Configuration PASS
tedd_an/makecheck success Make Check PASS
tedd_an/makecheckvalgrind success Make Check PASS
tedd_an/makedistcheck success Make Distcheck PASS
tedd_an/build_extell success Build External ELL PASS
tedd_an/build_extell_make success Build Make with External ELL PASS
tedd_an/incremental_build success Pass

Commit Message

Luiz Augusto von Dentz March 24, 2022, 9:36 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If mode is set to BT_MODE_LE SDP protocol won't be operational so it is
useless to attempt to add records.
---
 src/adapter.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com March 24, 2022, 11:25 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=626167

---Test result---

Test Summary:
CheckPatch                    FAIL      2.83 seconds
GitLint                       PASS      1.96 seconds
Prep - Setup ELL              PASS      39.94 seconds
Build - Prep                  PASS      0.74 seconds
Build - Configure             PASS      7.92 seconds
Build - Make                  PASS      1322.38 seconds
Make Check                    PASS      11.75 seconds
Make Check w/Valgrind         PASS      407.79 seconds
Make Distcheck                PASS      215.81 seconds
Build w/ext ELL - Configure   PASS      8.41 seconds
Build w/ext ELL - Make        PASS      1371.63 seconds
Incremental Build with patchesPASS      2697.11 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script with rule in .checkpatch.conf
Output:
[BlueZ,2/2] a2dp: Don't initialize a2dp_sep->destroy until properly registered
WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#93: 
   by 0x4A574A8: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.19.14)

/github/workspace/src/12791043.patch total: 0 errors, 1 warnings, 17 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/12791043.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.




---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org March 28, 2022, 6 p.m. UTC | #2
Hello:

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

On Thu, 24 Mar 2022 14:36:57 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> If mode is set to BT_MODE_LE SDP protocol won't be operational so it is
> useless to attempt to add records.
> ---
>  src/adapter.c | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)

Here is the summary with links:
  - [BlueZ,1/2] adapter: Fix adding SDP records when operating on LE only mode
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=4fefa24097e4
  - [BlueZ,2/2] a2dp: Don't initialize a2dp_sep->destroy until properly registered
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=18fc3abad28c

You are awesome, thank you!
diff mbox series

Patch

diff --git a/src/adapter.c b/src/adapter.c
index 1fcf75ec4..e8b84ccda 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1227,6 +1227,13 @@  int adapter_service_add(struct btd_adapter *adapter, sdp_record_t *rec)
 {
 	int ret;
 
+	/*
+	 * If the controller does not support BR/EDR operation,
+	 * there is no point in trying to add SDP records.
+	 */
+	if (btd_opts.mode == BT_MODE_LE)
+		return -ENOTSUP;
+
 	DBG("%s", adapter->path);
 
 	ret = add_record_to_server(&adapter->bdaddr, rec);
@@ -1240,10 +1247,17 @@  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 = sdp_record_find(handle);
+	sdp_record_t *rec;
+	/*
+	 * If the controller does not support BR/EDR operation,
+	 * there is no point in trying to remote SDP records.
+	 */
+	if (btd_opts.mode == BT_MODE_LE)
+		return;
 
 	DBG("%s", adapter->path);
 
+	rec = sdp_record_find(handle);
 	if (!rec)
 		return;