mirror of https://gitee.com/openkylin/linux.git
Bluetooth: hci_serdev: Only unregister device if it was registered
We should not call hci_unregister_dev if the device was not
successfully registered.
Fixes: c34dc3bfa7
("Bluetooth: hci_serdev: Introduce hci_uart_unregister_device()")
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
24b065727c
commit
202798db95
|
@ -355,7 +355,8 @@ void hci_uart_unregister_device(struct hci_uart *hu)
|
|||
struct hci_dev *hdev = hu->hdev;
|
||||
|
||||
clear_bit(HCI_UART_PROTO_READY, &hu->flags);
|
||||
hci_unregister_dev(hdev);
|
||||
if (test_bit(HCI_UART_REGISTERED, &hu->flags))
|
||||
hci_unregister_dev(hdev);
|
||||
hci_free_dev(hdev);
|
||||
|
||||
cancel_work_sync(&hu->write_work);
|
||||
|
|
Loading…
Reference in New Issue