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=1796381794; b=GXhnBO6D85uf9VATr4AV0OsDuDFff6M7iTAne+RvDOoZb8ieFIqDo6todLV13CNF2mXg LUDUAF0q8pE7W/oZJTQiEZ4oqMisZYzGeZ7BJKtKIyqO0UPLI87qM3KIA1AiaoNX0/h1X 3PrnSJyIu6IdgkWCFuGAu/Aa4ILGmdOVxBW9V/MoA/xQByb2xXVIG15X5QPGn531npJiB wDLsXAtv1bd05jWgWjI1aavmhzO/Sn4T7HW176JuiCl2y9VQKaho1ziJQxOGdrHs/8fyP m06xe8ItYj0Cv17ODnN6zRvXGFx6L525QbW7vEDQ/3LN63tfEOq8Q80KmsxMQLfbBcA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381794; 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=Qe/T1VhKKxnXpkYP/RQfTROH0Bysw3Ra1ybcACstloc=; b=R/1WW3elCKGzTFlV2bDMddFkvWhxfFhWpP1IGYo6IxtvFpVF4dxTUSGGwR5kVbeBY7gE FsMqvC6y+TWkrGQhL8iTcp+7bky/C//SSLRV365fokUognCwVJaCfc+sfpR/7fdRhX0wO zOddvY/NOrGiKIiKYgG2q62CxwKiB9DJPlOQjujLgHv1HortNuugCz7Xpak38F2ETFAiK Y+e7T/NMpFUeBLV62JSwcuM+HVBB/n8SFvxZWSxx/DdlDF3EstLPZYsi91QIxDp53U4m1 zFYURGmh41alxaUcosYgq9+e497kVPWgTGpdUhsJj7QuglQL31XJOh1072lnOFpFhSA== 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=J5On7AhO; 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 079D9606A333; Fri, 4 Dec 2026 10:56:34 +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=J5On7AhO Received: by smtp.kernel.org (Postfix) with ESMTPSA id 777BC1F000C2; Fri, 4 Dec 2026 10:56:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381793; bh=Qe/T1VhKKxnXpkYP/RQfTROH0Bysw3Ra1ybcACstloc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=J5On7AhOKzkmcSFjfLawarjlJz3KBwLCVK3Gs9QV+fL+3jcPfdPZYjTgbV/BkhRLS ItX+VmibD2+dhcyF1jgwc0s2uzeeH4cOdBRSo28xoA2nLHzkn6pBQ69fQY4YQJ1JFm Ix2X8unTtCLLatZrvLpos28MQ+hUgBPQ7yOml6PI= 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.18 175/703] Bluetooth: hci_core: Dont fail removing a monitor unknown to the controller Date: Fri, 4 Dec 2026 19:01:14 +0900 Message-ID: <20261204100632.530028281@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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.18-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 03ff64db62861..8f31efe7fa23a 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2069,7 +2069,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