Bluetooth: mgmt: Fix command status error code values
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 2 Mar 2012 01:07:07 +0000 (03:07 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 2 Mar 2012 01:19:24 +0000 (03:19 +0200)
Error codes in the command status should always be from the set of
values defined for mgmt and never e.g. POSIX error codes.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/mgmt.c

index 40b3da3d5e623035c7dc1d867248040c2ee30955..bd01e4a4784ebb7052ac37b6d638b5a38150f0d2 100644 (file)
@@ -2745,7 +2745,7 @@ int mgmt_index_added(struct hci_dev *hdev)
 
 int mgmt_index_removed(struct hci_dev *hdev)
 {
-       u8 status = ENODEV;
+       u8 status = MGMT_STATUS_INVALID_PARAMS;
 
        mgmt_pending_foreach(0, hdev, cmd_status_rsp, &status);
 
@@ -2798,7 +2798,7 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
                update_class(hdev);
                update_eir(hdev);
        } else {
-               u8 status = ENETDOWN;
+               u8 status = MGMT_STATUS_NOT_POWERED;
                mgmt_pending_foreach(0, hdev, cmd_status_rsp, &status);
        }