Bluetooth: Fix mgmt status for LL Privacy experimental feature
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 14 Mar 2021 13:49:38 +0000 (14:49 +0100)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 26 Mar 2021 19:58:13 +0000 (12:58 -0700)
The return error when trying to change the setting when a controller is
powered up, shall be MGMT_STATUS_REJECTED. However instead now the error
MGMT_STATUS_NOT_POWERED is used which is exactly the opposite.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/mgmt.c

index 90334ac..3df6f9c 100644 (file)
@@ -3982,7 +3982,7 @@ static int set_exp_feature(struct sock *sk, struct hci_dev *hdev,
                if (hdev_is_powered(hdev))
                        return mgmt_cmd_status(sk, hdev->id,
                                               MGMT_OP_SET_EXP_FEATURE,
-                                              MGMT_STATUS_NOT_POWERED);
+                                              MGMT_STATUS_REJECTED);
 
                /* Parameters are limited to a single octet */
                if (data_len != MGMT_SET_EXP_FEATURE_SIZE + 1)