diff mbox series

[BlueZ,v1,1/2] btdev: Fix not resetting big_handle on HCI_Reset

Message ID 20240227164403.1904213-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v1,1/2] btdev: Fix not resetting big_handle on HCI_Reset | expand

Commit Message

Luiz Augusto von Dentz Feb. 27, 2024, 4:44 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

HCI_Reset shall cleanup BIG state including if the handle has been set.
---
 emulator/btdev.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

bluez.test.bot@gmail.com Feb. 27, 2024, 6:21 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=830344

---Test result---

Test Summary:
CheckPatch                    FAIL      0.85 seconds
GitLint                       PASS      0.42 seconds
BuildEll                      PASS      24.00 seconds
BluezMake                     PASS      730.29 seconds
MakeCheck                     PASS      11.79 seconds
MakeDistcheck                 PASS      169.51 seconds
CheckValgrind                 PASS      232.43 seconds
CheckSmatch                   WARNING   338.75 seconds
bluezmakeextell               PASS      110.48 seconds
IncrementalBuild              PASS      1377.67 seconds
ScanBuild                     WARNING   989.44 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,v1,2/2] device: Consider service state on device_is_connected
WARNING:LINE_SPACING: Missing a blank line after declarations
#127: FILE: src/device.c:3285:
+		char addr[18];
+		ba2str(&dev->bdaddr, addr);

/github/workspace/src/src/13574121.patch total: 0 errors, 1 warnings, 25 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/src/13574121.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.


##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
emulator/btdev.c:434:29: warning: Variable length array is used.
##############################
Test: ScanBuild - WARNING
Desc: Run Scan Build
Output:
emulator/btdev.c:1099:10: warning: Although the value stored to 'conn' is used in the enclosing expression, the value is never actually read from 'conn'
        while ((conn = queue_find(dev->conns, match_handle,
                ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
emulator/btdev.c:1386:24: warning: Access to field 'link' results in a dereference of a null pointer (loaded from variable 'conn')
        pending_conn_del(dev, conn->link->dev);
                              ^~~~~~~~~~
emulator/btdev.c:1508:13: warning: Access to field 'dev' results in a dereference of a null pointer (loaded from variable 'conn')
        send_event(conn->dev, BT_HCI_EVT_AUTH_COMPLETE, &ev, sizeof(ev));
                   ^~~~~~~~~
3 warnings generated.



---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org Feb. 29, 2024, 2:30 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 Tue, 27 Feb 2024 11:44:02 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> HCI_Reset shall cleanup BIG state including if the handle has been set.
> ---
>  emulator/btdev.c | 4 ++++
>  1 file changed, 4 insertions(+)

Here is the summary with links:
  - [BlueZ,v1,1/2] btdev: Fix not resetting big_handle on HCI_Reset
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ade2b97597e1
  - [BlueZ,v1,2/2] device: Consider service state on device_is_connected
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=44d3f67277f8

You are awesome, thank you!
diff mbox series

Patch

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 3224b73bfc31..0ad6b2793c06 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -577,6 +577,7 @@  static void btdev_reset(struct btdev *btdev)
 	btdev->le_adv_enable		= 0x00;
 	btdev->le_pa_enable		= 0x00;
 	btdev->le_pa_sync_handle	= 0x0000;
+	btdev->big_handle		= 0xff;
 
 	al_clear(btdev);
 	rl_clear(btdev);
@@ -6483,6 +6484,9 @@  static int cmd_big_term_sync(struct btdev *dev, const void *data, uint8_t len)
 	}
 
 done:
+	if (rsp.status == BT_HCI_ERR_SUCCESS)
+		dev->big_handle = 0xff;
+
 	cmd_complete(dev, BT_HCI_CMD_LE_BIG_TERM_SYNC, &rsp, sizeof(rsp));
 
 	return 0;