Commit: 29f3c07b8dc95a17a128f2b461f133099fff3da7
Parent: 9bf6bb654ff78efafe8cb4c4d55b6acaa0f53c27
Author: Andrew Sayers <kernel.org@pileofstuff.org>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2025-04-29 20:54:05
Tree: 602aaef65d61b0c850e9cb434aba88eab64c3b95

obexd/bluetooth: Support calling bluetooth_init() after bluetooth_exit() bluetooth_exit() didn't previously unregister itself thoroughly. That was fine if it was only called when the service was about to exit, because everything was implicitly unregistered when the process ended. But we need to be more scrupulous if this can be called throughout the program's lifecycle. Send UnregisterProfile messages directly from bluetooth_exit(), then call unregister_profile(profile). The UnregisterProfile message can't be sent directly from unregister_profile(), because that also needs to be called when register_profile() fails halfway through. Do not free profiles in bluetooth_exit() - profiles are needed by a future call to bluetooth_init(), or will be freed by bluetooth_stop() if necessary.

Diffstat

M obexd/plugins/bluetooth.c | 16 ++++++++++++++- -

1 files changed, 14 insertions(+), 2 deletions(-)

View Full Diff | Patch