bluetooth-init: ensure the interface is up before unloading the module

This is a workaround for a driver failure when unloading the module. The
"btnxpuart" driver crashes with a null pointer dereference if the bluetooth
interface is down when the module is unloaded.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2024-09-27 14:09:23 +02:00
parent 55f8ccadec
commit 7b50fb3a06
1 changed files with 6 additions and 2 deletions

View File

@ -66,8 +66,12 @@ bluetooth_start() {
} }
bluetooth_stop() { bluetooth_stop() {
# Remove the kernel module #
rmmod "${MODULE_NAME}" # The btnxpuart driver hits a null pointer dereference on module
# unloading when the interface is down. So as a workaround, make
# sure the interface is UP before unloading the module.
#
hciconfig "${HCI_IFACE}" up && rmmod "${MODULE_NAME}"
power 0 power 0
} }