device: Fix crash when removing device
Luiz Augusto von Dentz
maintainerPATCH 1/1 device: Fix crash when removing device
From: Luiz Augusto von Dentz <[email protected]>
Calling btd_adapter_remove_device from device_remove_connection can cause a crash, so instead of removing it immediatelly this set a the temporary timeout to 0.
--- src/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/device.c +1 -1
@@ -3285,7 +3285,7 @@ void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type) DEVICE_INTERFACE, "Connected");if (remove_device) -btd_adapter_remove_device (device->adapter, device); +set_temporary_timer (device,0 ); } guint device_add_disconnect_watch(struct btd_device *device,
Signature · 1 line
2.34.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=613242
---Test result---
Test Summary:
CheckPatch FAIL 1.42 seconds GitLint PASS 1.04 seconds Prep - Setup ELL PASS 49.84 seconds Build - Prep PASS 0.76 seconds Build - Configure PASS 10.03 seconds Build - Make FAIL 1389.55 seconds Make Check FAIL 1.21 seconds Make Check w/Valgrind FAIL 345.81 seconds Make Distcheck FAIL 181.59 seconds Build w/ext ELL - Configure PASS 10.25 seconds Build w/ext ELL - Make FAIL 1368.03 seconds Incremental Build with patchesPASS 0.00 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script with rule in .checkpatch.conf Output:
[BlueZ] device: Fix crash when removing device WARNING:TYPO_SPELLING: 'immediatelly' may be misspelled - perhaps 'immediately'? #81:
cause a crash, so instead of removing it immediatelly this set a the
^^^^^^^^^^^^
/github/workspace/src/12742460.patch total: 0 errors, 1 warnings, 8 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/12742460.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: Build - Make - FAIL
Desc: Build the BlueZ source tree
Output:tools/mgmt-tester.c: In function ‘main’:tools/mgmt-tester.c:12364:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 12364 | int main(int argc, char *argv[])
| ^~~~
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/device.c: In function ‘device_remove_connection’:
src/device.c:3288:3: error: implicit declaration of function ‘set_temporary_timer’; did you mean ‘clear_temporary_timer’? [-Werror=implicit-function-declaration]
3288 | set_temporary_timer(device, 0);
| ^~~~~~~~~~~~~~~~~~~
| clear_temporary_timer
src/device.c: At top level:
src/device.c:4604:13: error: conflicting types for ‘set_temporary_timer’ [-Werror]
4604 | static void set_temporary_timer(struct btd_device *dev, unsigned int timeout)
| ^~~~~~~~~~~~~~~~~~~
src/device.c:4604:13: error: static declaration of ‘set_temporary_timer’ follows non-static declaration
src/device.c:3288:3: note: previous implicit declaration of ‘set_temporary_timer’ was here
3288 | set_temporary_timer(device, 0);
| ^~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errors
make[1]: *** [Makefile:10243: src/bluetoothd-device.o] Error 1
make: *** [Makefile:4308: all] Error 2
##############################
Test: Make Check - FAIL
Desc: Run 'make check'
Output:src/device.c: In function ‘device_remove_connection’:src/device.c:3288:3: error: implicit declaration of function ‘set_temporary_timer’; did you mean ‘clear_temporary_timer’? [-Werror=implicit-function-declaration]
3288 | set_temporary_timer(device, 0);
| ^~~~~~~~~~~~~~~~~~~
| clear_temporary_timer
src/device.c: At top level:
src/device.c:4604:13: error: conflicting types for ‘set_temporary_timer’ [-Werror]
4604 | static void set_temporary_timer(struct btd_device *dev, unsigned int timeout)
| ^~~~~~~~~~~~~~~~~~~
src/device.c:4604:13: error: static declaration of ‘set_temporary_timer’ follows non-static declaration
src/device.c:3288:3: note: previous implicit declaration of ‘set_temporary_timer’ was here
3288 | set_temporary_timer(device, 0);
| ^~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errors
make[1]: *** [Makefile:10243: src/bluetoothd-device.o] Error 1
make: *** [Makefile:11278: check] Error 2
##############################
Test: Make Check w/Valgrind - FAIL
Desc: Run 'make check' with Valgrind
Output:tools/mgmt-tester.c: In function ‘main’:tools/mgmt-tester.c:12364:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 12364 | int main(int argc, char *argv[])
| ^~~~
src/device.c: In function ‘device_remove_connection’:
src/device.c:3288:3: error: implicit declaration of function ‘set_temporary_timer’; did you mean ‘clear_temporary_timer’? [-Werror=implicit-function-declaration]
3288 | set_temporary_timer(device, 0);
| ^~~~~~~~~~~~~~~~~~~
| clear_temporary_timer
src/device.c: At top level:
src/device.c:4604:13: error: conflicting types for ‘set_temporary_timer’ [-Werror]
4604 | static void set_temporary_timer(struct btd_device *dev, unsigned int timeout)
| ^~~~~~~~~~~~~~~~~~~
src/device.c:4604:13: error: static declaration of ‘set_temporary_timer’ follows non-static declaration
src/device.c:3288:3: note: previous implicit declaration of ‘set_temporary_timer’ was here
3288 | set_temporary_timer(device, 0);
| ^~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errors
make[1]: *** [Makefile:10243: src/bluetoothd-device.o] Error 1
make: *** [Makefile:4308: all] Error 2
##############################
Test: Make Distcheck - FAIL
Desc: Run distcheck to check the distribution
Output:../../src/device.c: In function ‘device_remove_connection’:../../src/device.c:3288:3: warning: implicit declaration of function ‘set_temporary_timer’; did you mean ‘clear_temporary_timer’? [-Wimplicit-function-declaration]
3288 | set_temporary_timer(device, 0);
| ^~~~~~~~~~~~~~~~~~~
| clear_temporary_timer
../../src/device.c: At top level:
../../src/device.c:4604:13: warning: conflicting types for ‘set_temporary_timer’
4604 | static void set_temporary_timer(struct btd_device *dev, unsigned int timeout)
| ^~~~~~~~~~~~~~~~~~~
../../src/device.c:4604:13: error: static declaration of ‘set_temporary_timer’ follows non-static declaration
../../src/device.c:3288:3: note: previous implicit declaration of ‘set_temporary_timer’ was here
3288 | set_temporary_timer(device, 0);
| ^~~~~~~~~~~~~~~~~~~make[2]: *** [Makefile:10243: src/bluetoothd-device.o] Error 1 make[1]: *** [Makefile:4308: all] Error 2
make: *** [Makefile:11199: distcheck] Error 1
##############################
Test: Build w/ext ELL - Make - FAIL
Desc: Build BlueZ source with '--enable-external-ell' configuration
Output:tools/mgmt-tester.c: In function ‘main’:tools/mgmt-tester.c:12364:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 12364 | int main(int argc, char *argv[])
| ^~~~
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/device.c: In function ‘device_remove_connection’:
src/device.c:3288:3: error: implicit declaration of function ‘set_temporary_timer’; did you mean ‘clear_temporary_timer’? [-Werror=implicit-function-declaration]
3288 | set_temporary_timer(device, 0);
| ^~~~~~~~~~~~~~~~~~~
| clear_temporary_timer
src/device.c: At top level:
src/device.c:4604:13: error: conflicting types for ‘set_temporary_timer’ [-Werror]
4604 | static void set_temporary_timer(struct btd_device *dev, unsigned int timeout)
| ^~~~~~~~~~~~~~~~~~~
src/device.c:4604:13: error: static declaration of ‘set_temporary_timer’ follows non-static declaration
src/device.c:3288:3: note: previous implicit declaration of ‘set_temporary_timer’ was here
3288 | set_temporary_timer(device, 0);
| ^~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errors
make[1]: *** [Makefile:10243: src/bluetoothd-device.o] Error 1
make: *** [Makefile:4308: all] Error 2
---
Regards,
Linux Bluetooth