FAILED: patch "[PATCH] Bluetooth: hci_sync: Fix not checking error on" failed to apply to 6.6-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 6946b9c99bde45f3ba74e00a7af9a3458cc24bea
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2024040517-taking-thousand-bac2@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 6946b9c99bde45f3ba74e00a7af9a3458cc24bea Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <[email protected]>
Date: Tue, 26 Mar 2024 12:43:17 -0400
Subject: [PATCH] Bluetooth: hci_sync: Fix not checking error on
hci_cmd_sync_cancel_sync
hci_cmd_sync_cancel_sync shall check the error passed to it since it will be propagated using req_result which is __u32 it needs to be properly set to a positive value if it was passed as negative othertise IS_ERR will not trigger as -(errno) would be converted to a positive value.
net/bluetooth/hci_core.c +3 -3
@@ -2874,7 +2874,7 @@ static void hci_cancel_cmd_sync(struct hci_dev *hdev, int err)cancel_delayed_work_sync (&hdev->ncmd_timer);atomic_set (&hdev->cmd_cnt,1 ); -hci_cmd_sync_cancel_sync (hdev, -err); +hci_cmd_sync_cancel_sync (hdev, err); }/* Suspend HCI device */
@@ -2894,7 +2894,7 @@ int hci_suspend_dev(struct hci_dev *hdev)return 0 ;/* Cancel potentially blocking sync operation before suspend */ -hci_cancel_cmd_sync (hdev, -EHOSTDOWN ); +hci_cancel_cmd_sync (hdev,EHOSTDOWN );hci_req_sync_lock (hdev); ret =hci_suspend_sync (hdev);
@@ -4210,7 +4210,7 @@ static void hci_send_cmd_sync(struct hci_dev *hdev, struct sk_buff *skb) err =hci_send_frame (hdev, skb);if (err <0 ) { -hci_cmd_sync_cancel_sync (hdev, err); +hci_cmd_sync_cancel_sync (hdev, -err);return ; }
net/bluetooth/hci_sync.c +4 -1
@@ -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);