Bluetooth: Fix crash when ioctl(HCIUARTSETPROTO) fails
authorGustavo F. Padovan <padovan@profusion.mobi>
Tue, 15 Feb 2011 23:22:03 +0000 (20:22 -0300)
committerGustavo F. Padovan <padovan@profusion.mobi>
Wed, 16 Feb 2011 19:33:24 +0000 (16:33 -0300)
If the fail happens the HCI del_timer may timeout after the the hci dev
unregister. This lead to a kernel crash.

Reported-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/hci_core.c

index 173bebd42825ddf3f9cfb89b3266ea890ded1fa0..c01415bc89466aa8ad775d9069d3b865f62bc329 100644 (file)
@@ -1199,6 +1199,8 @@ int hci_unregister_dev(struct hci_dev *hdev)
 
        hci_unregister_sysfs(hdev);
 
+       hci_del_off_timer(hdev);
+
        destroy_workqueue(hdev->workqueue);
 
        hci_dev_lock_bh(hdev);