lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251222123824.3000167-1-jinwang.li@oss.qualcomm.com>
Date: Mon, 22 Dec 2025 20:38:24 +0800
From: jinwli <jinwang.li@....qualcomm.com>
To: Marcel Holtmann <marcel@...tmann.org>,
        Johan Hedberg <johan.hedberg@...il.com>,
        Luiz Augusto von Dentz <luiz.dentz@...il.com>
Cc: linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org, cheng.jiang@....qualcomm.com,
        quic_chezhou@...cinc.com, wei.deng@....qualcomm.com,
        shuai.zhang@....qualcomm.com, mengshi.wu@....qualcomm.com,
        jinwang.li@....qualcomm.com
Subject: [PATCH v1] FROMLIST: driver: bluetooth: hci_qca: Always perform cleanup on every setup failure

The retry logic in qca_setup combined error handling and
retry gating under a single condition. This caused the final failed
attempt (when retries reached MAX_INIT_RETRIES) to return without
performing cleanup.

So only jumping to retry when there is a error and retries have not
reached MAX_INIT_RETRIES.

Signed-off-by: jinwli <jinwang.li@....qualcomm.com>
---
 drivers/bluetooth/hci_qca.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 1d3b62579..b695577f8 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -2026,7 +2026,7 @@ static int qca_setup(struct hci_uart *hu)
 	}
 
 out:
-	if (ret && retries < MAX_INIT_RETRIES) {
+	if (ret) {
 		bt_dev_warn(hdev, "Retry BT power ON:%d", retries);
 		qca_power_shutdown(hu);
 		if (hu->serdev) {
@@ -2037,8 +2037,10 @@ static int qca_setup(struct hci_uart *hu)
 				return ret;
 			}
 		}
-		retries++;
-		goto retry;
+		if (retries < MAX_INIT_RETRIES) {
+			retries++;
+			goto retry;
+		}
 	}
 
 	/* Setup bdaddr */
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ