Bluetooth: hci_sync: Fix not checking error on hci_cmd_sync_cancel_sync
[linux.git] / net / bluetooth / hci_sync.c
index 639090b9f4b85bf225da0457fdac2dda3f855334..8fe02921adf15d4b968be310415bf9383ae3d63d 100644 (file)
@@ -617,7 +617,10 @@ void hci_cmd_sync_cancel_sync(struct hci_dev *hdev, int err)
        bt_dev_dbg(hdev, "err 0x%2.2x", err);
 
        if (hdev->req_status == HCI_REQ_PEND) {
-               hdev->req_result = err;
+               /* req_result is __u32 so error must be positive to be properly
+                * propagated.
+                */
+               hdev->req_result = err < 0 ? -err : err;
                hdev->req_status = HCI_REQ_CANCELED;
 
                wake_up_interruptible(&hdev->req_wait_q);
This page took 0.032167 seconds and 4 git commands to generate.