diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-10 12:06:04 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2013-10-10 12:13:45 -0400 |
commit | cebf4cfd8608cbcc941750801217988f0a8fc848 (patch) | |
tree | 0c17800a5da36569359f419278087ab79e9ce42d /net/bluetooth/mgmt.c | |
parent | c4e5bafa661126b7b42459ad32d4c2cc589ef8fb (diff) |
Bluetooth: Fix checking for HCI_SETUP flag when receiving mgmt commands
When the HCI_SETUP flag is set the controller has not yet been announced
over mgmt and therefore doesn't exist from that perspective. If we
nevertheless get a mgmt command for it we should respond with the
appropriate INVALID_INDEX error.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index e7ffd39100a0..7d25d6dcd79d 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -3753,7 +3753,8 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen) | |||
3753 | goto done; | 3753 | goto done; |
3754 | } | 3754 | } |
3755 | 3755 | ||
3756 | if (test_bit(HCI_USER_CHANNEL, &hdev->dev_flags)) { | 3756 | if (test_bit(HCI_SETUP, &hdev->dev_flags) || |
3757 | test_bit(HCI_USER_CHANNEL, &hdev->dev_flags)) { | ||
3757 | err = cmd_status(sk, index, opcode, | 3758 | err = cmd_status(sk, index, opcode, |
3758 | MGMT_STATUS_INVALID_INDEX); | 3759 | MGMT_STATUS_INVALID_INDEX); |
3759 | goto done; | 3760 | goto done; |