From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383364; b=VjOCjHf5y/RTk4kp0OBBl0j6sZm/l/FWfBtzJtiUXtwH9h2IoM0UanwG7e3dZ7RYqeqS HrhTy8WA1fjLwzkzkS90hFvY+9mqrOkX4Q5S/b5cGURSrajhi7Aum7MlHGNfBq3ReNBqM zGW21wH1ieY8wETSEfqFqjKSQp+/oCOwQu398z186U12ZzH1VAGGyV26YIobJqtMlQFmG 1eVSn7ooPEWBNhg/vtmK+PATwMSegml0DxGeUuiz5IEIJttwyl7KzNImaCAf6C+SvXMQN iolBiU9+tkiM3rEOr7y6Sd8JdYa7F0ICU4A5CsmBB5dLsc0AvHorNKBTi9RxoW7OL+Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383364; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=EhdQuncHi+7jqrL3+ow8VSbBZV5xb7GcNp7/GnHzuww=; b=G72R381jRBCeEmS9CDSSqvWmsfkAIoP6yw9n0DrYQtRObbHw4H7KHhzDfdGmSYvIwzDu zy6+7vJQ8HyCW/GZldfdlaKdw9hr7NsE9ORB6pvSrWuvKWvZASVx6u3hsmA3q2qKEhy7D uA/PSaziBFtaqawoa9zwYDdFhwFPpsucZXFuGlsU7BmC0kjbTtLSFE7cYxY5/xiUyYTSj aY0VYaTT53VL87z8W5QauUc/gmBj6pxR2Q7Jd44GnpQznZUeKraF1AeQlDKkQs+xFgYZo Y+xPU3W74eJV6A8ilulfk8+qFklTQx+hvkcFFXVSv8BXqUjul8eI8wjyfxZbl+FCQuQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=hcn2tUW8; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2078D606A32C; Fri, 4 Dec 2026 11:22:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=hcn2tUW8 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 921EE1F000CE; Fri, 4 Dec 2026 11:22:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383364; bh=EhdQuncHi+7jqrL3+ow8VSbBZV5xb7GcNp7/GnHzuww=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hcn2tUW8Ra3SSuxPGUw+6MfNImEAQat0fyvn1EZS6IuZqFd7PMjyK3L7J2wAFn6gF AFzgenkTKw0yFKpm1r5YW3MzzBqhYjYOd4SpHoouFjW8Bh62NCFjiAvnyUQmTi5/5C PqEcNczhQudN8a4DyED9eSTMglDZIneiZZwjj2QQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.12 195/555] Bluetooth: hci_core: Dont fail removing a monitor unknown to the controller Date: Fri, 4 Dec 2026 19:03:58 +0900 Message-ID: <20261204100615.608933047@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Luiz Augusto von Dentz [ Upstream commit 8d3e5e6fe6d0be5634b28788abf5685d571b13a4 ] hci_remove_adv_monitor() frees the monitor when the controller has no matching handle for it but still returned -ENOENT, so callers took it for a failure of a monitor that is gone, and hci_remove_all_adv_monitor() stopped at the first one leaving the others behind. Return success since the monitor was removed. Found by the sashiko.dev review of the previous revision of this series. Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20261117185737.3758255-1-luiz.dentz%40gmail.com Fixes: 7cf5c2978f23 ("Bluetooth: hci_sync: Refactor remove Adv Monitor") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- net/bluetooth/hci_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 7811d7a3f6052..2c52e4369453e 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2071,7 +2071,10 @@ static int hci_remove_adv_monitor(struct hci_dev *hdev, hci_free_adv_monitor(hdev, monitor); hci_dev_unlock(hdev); - return status; + /* The monitor is gone, not having been known by the controller is not + * an error for the caller. + */ + return status == -ENOENT ? 0 : status; } /* This function requires the caller holds hci_req_sync_lock */ -- 2.53.0