* [PATCH BlueZ] device: Fix crash when removing device
@ 2022-02-10 22:14 Luiz Augusto von Dentz
2022-02-10 23:18 ` [BlueZ] " bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2022-02-10 22:14 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
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.
Fixes: https://github.com/bluez/bluez/issues/290
---
src/device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/device.c b/src/device.c
index 6d29eb896..b5a47d302 100644
--- a/src/device.c
+++ b/src/device.c
@@ -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,
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [BlueZ] device: Fix crash when removing device
2022-02-10 22:14 [PATCH BlueZ] device: Fix crash when removing device Luiz Augusto von Dentz
@ 2022-02-10 23:18 ` bluez.test.bot
0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2022-02-10 23:18 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 9136 bytes --]
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-10 23:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-10 22:14 [PATCH BlueZ] device: Fix crash when removing device Luiz Augusto von Dentz
2022-02-10 23:18 ` [BlueZ] " bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).