]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Bluetooth: Replace EPERM by EALREADY in hci_cancel_inquiry
authorAndre Guedes <aguedespe@gmail.com>
Tue, 20 Mar 2012 03:13:38 +0000 (00:13 -0300)
committerGustavo Padovan <gustavo@padovan.org>
Wed, 28 Mar 2012 15:28:48 +0000 (12:28 -0300)
We should return -EALREADY in hci_cancel_inquiry since it is more
suitable than -EPERM error code.

Signed-off-by: Andre Guedes <aguedespe@gmail.com>
Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
net/bluetooth/hci_core.c

index 68b58af0d60c9db794141ede1a08df8b287e5f70..286f3fcce63541928b344fe2cb46096195c494ee 100644 (file)
@@ -2958,7 +2958,7 @@ int hci_cancel_inquiry(struct hci_dev *hdev)
        BT_DBG("%s", hdev->name);
 
        if (!test_bit(HCI_INQUIRY, &hdev->flags))
-               return -EPERM;
+               return -EALREADY;
 
        return hci_send_cmd(hdev, HCI_OP_INQUIRY_CANCEL, 0, NULL);
 }