Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9319560 authored by Jun Nie's avatar Jun Nie Committed by Gustavo Padovan
Browse files

Bluetooth: add NULL pointer check in HCI



If we fail to find a hci device pointer in hci_uart, don't try
to deref the NULL one we do have.

Signed-off-by: default avatarJun Nie <njun@marvell.com>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent 183f732c
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -311,11 +311,13 @@ static void hci_uart_tty_close(struct tty_struct *tty)


		if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
		if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
			hu->proto->close(hu);
			hu->proto->close(hu);
			if (hdev) {
				hci_unregister_dev(hdev);
				hci_unregister_dev(hdev);
				hci_free_dev(hdev);
				hci_free_dev(hdev);
			}
			}
		}
		}
	}
	}
}


/* hci_uart_tty_wakeup()
/* hci_uart_tty_wakeup()
 *
 *