2.4.36-stable kernel tree
リビジョン | 8cbb9dae3e720db4bb055ff818f1a80173c9c768 (tree) |
---|---|
日時 | 2007-06-06 14:59:12 |
作者 | Willy Tarreau <w@1wt....> |
コミッター | Willy Tarreau |
[BACKPORT] Bluetooth: Fix NULL pointer dereference in HCI line discipline
Backport from this 2.6 patch :
Normally a serial Bluetooth device is opened, TIOSETD'ed to N_HCI line
discipline, HCIUARTSETPROTO'ed and finally closed. In case the device
fails to HCIUARTSETPROTO, closing it produces a NULL pointer dereference.
Signed-off-by: Ohad Ben-Cohen <ohad@bencohen.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
@@ -309,7 +309,9 @@ static void hci_uart_tty_close(struct tty_struct *tty) | ||
309 | 309 | |
310 | 310 | if (hu) { |
311 | 311 | struct hci_dev *hdev = &hu->hdev; |
312 | - hci_uart_close(hdev); | |
312 | + | |
313 | + if (hdev) | |
314 | + hci_uart_close(hdev); | |
313 | 315 | |
314 | 316 | if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) { |
315 | 317 | hu->proto->close(hu); |