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

Commit 6994ca5e authored by Johan Hedberg's avatar Johan Hedberg Committed by Gustavo Padovan
Browse files

Bluetooth: Fix missing hci_dev_lock_bh in user_confirm_reply



The code was correctly calling _unlock at the end of the function but
there was no actual _lock call anywhere.

Signed-off-by: default avatarJohan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent 8763b4da
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1230,6 +1230,8 @@ static int user_confirm_reply(struct sock *sk, u16 index, unsigned char *data,
	if (!hdev)
	if (!hdev)
		return cmd_status(sk, index, mgmt_op, ENODEV);
		return cmd_status(sk, index, mgmt_op, ENODEV);


	hci_dev_lock_bh(hdev);

	if (!test_bit(HCI_UP, &hdev->flags)) {
	if (!test_bit(HCI_UP, &hdev->flags)) {
		err = cmd_status(sk, index, mgmt_op, ENETDOWN);
		err = cmd_status(sk, index, mgmt_op, ENETDOWN);
		goto failed;
		goto failed;