diff mbox series

[BlueZ] device: Clear pending_flags on error

Message ID 20250128102828.16087-1-ludovico.denittis@collabora.com (mailing list archive)
State Superseded
Headers show
Series [BlueZ] device: Clear pending_flags on error | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake fail BluezMake FAIL: tools/mgmt-tester.c: In function ‘main’: tools/mgmt-tester.c:12893:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 12893 | int main(int argc, char *argv[]) | ^~~~ src/adapter.c: In function ‘set_device_privacy_complete’: src/adapter.c:5583:6: error: dereferencing pointer to incomplete type ‘struct btd_device’ 5583 | dev->pending_flags = 0; | ^~ make[1]: *** [Makefile:11105: src/bluetoothd-adapter.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:4693: all] Error 2
tedd_an/MakeCheck fail BlueZ Make Check FAIL:
tedd_an/MakeDistcheck fail Make Distcheck FAIL: Package cups was not found in the pkg-config search path. Perhaps you should add the directory containing `cups.pc' to the PKG_CONFIG_PATH environment variable No package 'cups' found ../../src/adapter.c: In function ‘set_device_privacy_complete’: ../../src/adapter.c:5583:6: error: dereferencing pointer to incomplete type ‘struct btd_device’ 5583 | dev->pending_flags = 0; | ^~ make[2]: *** [Makefile:11105: src/bluetoothd-adapter.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [Makefile:4693: all] Error 2 make: *** [Makefile:12265: distcheck] Error 1
tedd_an/CheckValgrind fail Check Valgrind FAIL: tools/mgmt-tester.c: In function ‘main’: tools/mgmt-tester.c:12893:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 12893 | int main(int argc, char *argv[]) | ^~~~ src/adapter.c: In function ‘set_device_privacy_complete’: src/adapter.c:5583:6: error: dereferencing pointer to incomplete type ‘struct btd_device’ 5583 | dev->pending_flags = 0; | ^~ make[1]: *** [Makefile:11105: src/bluetoothd-adapter.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:12344: check] Error 2
tedd_an/CheckSmatch fail CheckSparse: FAIL: src/shared/crypto.c:271:21: warning: Variable length array is used. src/shared/crypto.c:272:23: warning: Variable length array is used. src/shared/gatt-helpers.c:768:31: warning: Variable length array is used. src/shared/gatt-helpers.c:830:31: warning: Variable length array is used. src/shared/gatt-helpers.c:1323:31: warning: Variable length array is used. src/shared/gatt-helpers.c:1354:23: warning: Variable length array is used. src/shared/gatt-server.c:278:25: warning: Variable length array is used. src/shared/gatt-server.c:618:25: warning: Variable length array is used. src/shared/gatt-server.c:716:25: warning: Variable length array is used. src/shared/bap.c:296:25: warning: array of flexible structures src/shared/bap.c: note: in included file: ./src/shared/ascs.h:88:25: warning: array of flexible structures src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h): /usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function' /usr/include/readline/rltypedefs.h:36:25: warning: non-ANSI function declaration of function 'VFunction' /usr/include/readline/rltypedefs.h:37:27: warning: non-ANSI function declaration of function 'CPFunction' /usr/include/readline/rltypedefs.h:38:29: warning: non-ANSI function declaration of function 'CPPFunction' src/shared/crypto.c:271:21: warning: Variable length array is used. src/shared/crypto.c:272:23: warning: Variable length array is used. src/shared/gatt-helpers.c:768:31: warning: Variable length array is used. src/shared/gatt-helpers.c:830:31: warning: Variable length array is used. src/shared/gatt-helpers.c:1323:31: warning: Variable length array is used. src/shared/gatt-helpers.c:1354:23: warning: Variable length array is used. src/shared/gatt-server.c:278:25: warning: Variable length array is used. src/shared/gatt-server.c:618:25: warning: Variable length array is used. src/shared/gatt-server.c:716:25: warning: Variable length array is used. src/shared/bap.c:296:25: warning: array of flexible structures src/shared/bap.c: note: in included file: ./src/shared/ascs.h:88:25: warning: array of flexible structures src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h): /usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function' /usr/include/readline/rltypedefs.h:36:25: warning: non-ANSI function declaration of function 'VFunction' /usr/include/readline/rltypedefs.h:37:27: warning: non-ANSI function declaration of function 'CPFunction' /usr/include/readline/rltypedefs.h:38:29: warning: non-ANSI function declaration of function 'CPPFunction' tools/mesh-cfgtest.c:1453:17: warning: unknown escape sequence: '\%' tools/sco-tester.c: note: in included file: ./lib/bluetooth.h:232:15: warning: array of flexible structures ./lib/bluetooth.h:237:31: warning: array of flexible structures tools/bneptest.c:634:39: warning: unknown escape sequence: '\%' tools/seq2bseq.c:57:26: warning: Variable length array is used. tools/obex-client-tool.c: note: in included file (through /usr/include/readline/readline.h): /usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function' /usr/include/readline/rltypedefs.h:36:25: warning: non-ANSI function declaration of function 'VFunction' /usr/include/readline/rltypedefs.h:37:27: warning: non-ANSI function declaration of function 'CPFunction' /usr/include/readline/rltypedefs.h:38:29: warning: non-ANSI function declaration of function 'CPPFunction' android/avctp.c:505:34: warning: Variable length array is used. android/avctp.c:556:34: warning: Variable length array is used. unit/test-avrcp.c:373:26: warning: Variable length array is used. unit/test-avrcp.c:398:26: warning: Variable length array is used. unit/test-avrcp.c:414:24: warning: Variable length array is used. android/avrcp-lib.c:1085:34: warning: Variable length array is used. android/avrcp-lib.c:1583:34: warning: Variable length array is used. android/avrcp-lib.c:1612:34: warning: Variable length array is used. android/avrcp-lib.c:1638:34: warning: Variable length array is used. src/adapter.c: In function ‘set_device_privacy_complete’: src/adapter.c:5583:6: error: dereferencing pointer to incomplete type ‘struct btd_device’ 5583 | dev->pending_flags = 0; | ^~ make[1]: *** [Makefile:11105: src/bluetoothd-adapter.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:4693: all] Error 2
tedd_an/bluezmakeextell fail Make External ELL FAIL: src/adapter.c: In function ‘set_device_privacy_complete’: src/adapter.c:5583:6: error: dereferencing pointer to incomplete type ‘struct btd_device’ 5583 | dev->pending_flags = 0; | ^~ make[1]: *** [Makefile:11105: src/bluetoothd-adapter.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:4693: all] Error 2
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Ludovico de Nittis Jan. 28, 2025, 10:28 a.m. UTC
If setting WakeAllowed, or the device privacy, fails, we may end up in a
situation where `pending_flags` is still set to some `DEVICE_FLAG_*`
values, for example from `device_set_wake_allowed()` or
`adapter_set_device_flags()`.

This can confuse further requests because they'll assume that there is
still a pending request in progress.
---
 src/adapter.c | 1 +
 src/device.c  | 1 +
 2 files changed, 2 insertions(+)

Comments

bluez.test.bot@gmail.com Jan. 28, 2025, 11:36 a.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=928791

---Test result---

Test Summary:
CheckPatch                    PENDING   0.21 seconds
GitLint                       PENDING   0.23 seconds
BuildEll                      PASS      20.68 seconds
BluezMake                     FAIL      80.45 seconds
MakeCheck                     FAIL      1990.27 seconds
MakeDistcheck                 FAIL      54.70 seconds
CheckValgrind                 FAIL      59.70 seconds
CheckSmatch                   FAIL      149.91 seconds
bluezmakeextell               FAIL      69.10 seconds
IncrementalBuild              PENDING   0.26 seconds
ScanBuild                     PASS      885.48 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: BluezMake - FAIL
Desc: Build BlueZ
Output:

tools/mgmt-tester.c: In function ‘main’:
tools/mgmt-tester.c:12893:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
12893 | int main(int argc, char *argv[])
      |     ^~~~
src/adapter.c: In function ‘set_device_privacy_complete’:
src/adapter.c:5583:6: error: dereferencing pointer to incomplete type ‘struct btd_device’
 5583 |   dev->pending_flags = 0;
      |      ^~
make[1]: *** [Makefile:11105: src/bluetoothd-adapter.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4693: all] Error 2
##############################
Test: MakeCheck - FAIL
Desc: Run Bluez Make Check
Output:

unit/test-avdtp.c: In function ‘main’:
unit/test-avdtp.c:766:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
  766 | int main(int argc, char *argv[])
      |     ^~~~
unit/test-avrcp.c: In function ‘main’:
unit/test-avrcp.c:989:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
  989 | int main(int argc, char *argv[])
      |     ^~~~
src/adapter.c: In function ‘set_device_privacy_complete’:
src/adapter.c:5583:6: error: dereferencing pointer to incomplete type ‘struct btd_device’
 5583 |   dev->pending_flags = 0;
      |      ^~
make[1]: *** [Makefile:11105: src/bluetoothd-adapter.o] Error 1
make: *** [Makefile:12344: check] Error 2
##############################
Test: MakeDistcheck - FAIL
Desc: Run Bluez Make Distcheck
Output:

Package cups was not found in the pkg-config search path.
Perhaps you should add the directory containing `cups.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cups' found
../../src/adapter.c: In function ‘set_device_privacy_complete’:
../../src/adapter.c:5583:6: error: dereferencing pointer to incomplete type ‘struct btd_device’
 5583 |   dev->pending_flags = 0;
      |      ^~
make[2]: *** [Makefile:11105: src/bluetoothd-adapter.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:4693: all] Error 2
make: *** [Makefile:12265: distcheck] Error 1
##############################
Test: CheckValgrind - FAIL
Desc: Run Bluez Make Check with Valgrind
Output:

tools/mgmt-tester.c: In function ‘main’:
tools/mgmt-tester.c:12893:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
12893 | int main(int argc, char *argv[])
      |     ^~~~
src/adapter.c: In function ‘set_device_privacy_complete’:
src/adapter.c:5583:6: error: dereferencing pointer to incomplete type ‘struct btd_device’
 5583 |   dev->pending_flags = 0;
      |      ^~
make[1]: *** [Makefile:11105: src/bluetoothd-adapter.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:12344: check] Error 2
##############################
Test: CheckSmatch - FAIL
Desc: Run smatch tool with source
Output:

src/shared/crypto.c:271:21: warning: Variable length array is used.
src/shared/crypto.c:272:23: warning: Variable length array is used.
src/shared/gatt-helpers.c:768:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:830:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:1323:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:1354:23: warning: Variable length array is used.
src/shared/gatt-server.c:278:25: warning: Variable length array is used.
src/shared/gatt-server.c:618:25: warning: Variable length array is used.
src/shared/gatt-server.c:716:25: warning: Variable length array is used.
src/shared/bap.c:296:25: warning: array of flexible structures
src/shared/bap.c: note: in included file:
./src/shared/ascs.h:88:25: warning: array of flexible structures
src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):
/usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function'
/usr/include/readline/rltypedefs.h:36:25: warning: non-ANSI function declaration of function 'VFunction'
/usr/include/readline/rltypedefs.h:37:27: warning: non-ANSI function declaration of function 'CPFunction'
/usr/include/readline/rltypedefs.h:38:29: warning: non-ANSI function declaration of function 'CPPFunction'
src/shared/crypto.c:271:21: warning: Variable length array is used.
src/shared/crypto.c:272:23: warning: Variable length array is used.
src/shared/gatt-helpers.c:768:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:830:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:1323:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:1354:23: warning: Variable length array is used.
src/shared/gatt-server.c:278:25: warning: Variable length array is used.
src/shared/gatt-server.c:618:25: warning: Variable length array is used.
src/shared/gatt-server.c:716:25: warning: Variable length array is used.
src/shared/bap.c:296:25: warning: array of flexible structures
src/shared/bap.c: note: in included file:
./src/shared/ascs.h:88:25: warning: array of flexible structures
src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):
/usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function'
/usr/include/readline/rltypedefs.h:36:25: warning: non-ANSI function declaration of function 'VFunction'
/usr/include/readline/rltypedefs.h:37:27: warning: non-ANSI function declaration of function 'CPFunction'
/usr/include/readline/rltypedefs.h:38:29: warning: non-ANSI function declaration of function 'CPPFunction'
tools/mesh-cfgtest.c:1453:17: warning: unknown escape sequence: '\%'
tools/sco-tester.c: note: in included file:
./lib/bluetooth.h:232:15: warning: array of flexible structures
./lib/bluetooth.h:237:31: warning: array of flexible structures
tools/bneptest.c:634:39: warning: unknown escape sequence: '\%'
tools/seq2bseq.c:57:26: warning: Variable length array is used.
tools/obex-client-tool.c: note: in included file (through /usr/include/readline/readline.h):
/usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function'
/usr/include/readline/rltypedefs.h:36:25: warning: non-ANSI function declaration of function 'VFunction'
/usr/include/readline/rltypedefs.h:37:27: warning: non-ANSI function declaration of function 'CPFunction'
/usr/include/readline/rltypedefs.h:38:29: warning: non-ANSI function declaration of function 'CPPFunction'
android/avctp.c:505:34: warning: Variable length array is used.
android/avctp.c:556:34: warning: Variable length array is used.
unit/test-avrcp.c:373:26: warning: Variable length array is used.
unit/test-avrcp.c:398:26: warning: Variable length array is used.
unit/test-avrcp.c:414:24: warning: Variable length array is used.
android/avrcp-lib.c:1085:34: warning: Variable length array is used.
android/avrcp-lib.c:1583:34: warning: Variable length array is used.
android/avrcp-lib.c:1612:34: warning: Variable length array is used.
android/avrcp-lib.c:1638:34: warning: Variable length array is used.
src/adapter.c: In function ‘set_device_privacy_complete’:
src/adapter.c:5583:6: error: dereferencing pointer to incomplete type ‘struct btd_device’
 5583 |   dev->pending_flags = 0;
      |      ^~
make[1]: *** [Makefile:11105: src/bluetoothd-adapter.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4693: all] Error 2
##############################
Test: bluezmakeextell - FAIL
Desc: Build Bluez with External ELL
Output:

src/adapter.c: In function ‘set_device_privacy_complete’:
src/adapter.c:5583:6: error: dereferencing pointer to incomplete type ‘struct btd_device’
 5583 |   dev->pending_flags = 0;
      |      ^~
make[1]: *** [Makefile:11105: src/bluetoothd-adapter.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4693: all] Error 2
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/src/adapter.c b/src/adapter.c
index 5d4117a49..749662586 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -5580,6 +5580,7 @@  static void set_device_privacy_complete(uint8_t status, uint16_t length,
 	if (status != MGMT_STATUS_SUCCESS) {
 		error("Set device flags return status: %s",
 					mgmt_errstr(status));
+		dev->pending_flags = 0;
 		return;
 	}
 
diff --git a/src/device.c b/src/device.c
index e8bff718c..3c2337198 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1575,6 +1575,7 @@  static void set_wake_allowed_complete(uint8_t status, uint16_t length,
 			dev->wake_id = -1U;
 		}
 		dev->pending_wake_allowed = FALSE;
+		dev->pending_flags = 0;
 		return;
 	}