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=1796386264; b=0N34FIV/XFKUo62tx6K7rSq1KuRVF6L0T5Rt+OznH1W+cBGLmjppWKCfcB9vK4ZG5j5k fMEExpphhqs+GQqHkbuAH5NlgCZA6oAoSUDuSWx0yU+KqDzrbgrgAu55oOalaKVNOSJLq iCWFVTGaQ/xs8j4UZ3TW/3s4YsJtNtPUymmA4VWq3sK8xOp2bsfNe7/GtE4qSrciOG/Np 3ODzH5BceFKM7lagt86J/yXgfJwStYbj0GHw5U38kgUymHCaQ/0uyAeVKpZfOvtYUkLo0 Dol0ClCl33ImzMGx7nH8XAWQe6lmuqlzX8PxXKx60vVJ+dhiktJWnY7ZV6GSSfSXGEA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386264; 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=QYTPOnhy9oS43WpAMHUkW2zOfVQ8MJDmO7tMTRD+VEY=; b=cGW26GaXQ9TFoQhWfkTvjUshS1LCGjXRJK1Vwie+5h+Xs/7W+OxGhECKGMGYl1aUUV/g DYfjYPTKjggq+vA8deXPZuDMv3WUPerTfZ1MtPfc3rFo8wQafaUkkovJrFbBeJk9GQ5LI wN3AlVK2rEQINEetKvgvggIYA1DFqQ9MsolZvDgV6+Q+983SMKx7rsm/rdyqYJIp3X9H8 m69SYqieUdWAW8QgCiFZo38Ba5w81WhPf5G0cgai+2/RZuj07WvPqLoSxFz/QQm87s/+F c5wlzddM4Rlu++OZjV7dzFzuw+rqpeHCiSFjb/3wXvU4WrZDohDbkGwUElfCaIPmMZQ== 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=BU5t6x2K; 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 3CC01606A681; Fri, 4 Dec 2026 12:11:04 +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=BU5t6x2K Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C4891F00931; Fri, 4 Dec 2026 12:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386263; bh=QYTPOnhy9oS43WpAMHUkW2zOfVQ8MJDmO7tMTRD+VEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BU5t6x2KOTOiGWXbcHB5eFkwhfGjvUf6f9oKZELvL55owvbYPdrUYr2wvmUlI2udv hOYxlVqEAqFbOselXWe4s09BBIZe8XTGTacZWFlAEaRlm1crCmK7VO0stOjjNY94Nl uVhtFvxLAvKCbghWTpGFaF6RO/JnWPs4zBJi5574= 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.6 0889/1167] Bluetooth: hci_core: Dont fail removing a monitor unknown to the controller Date: Fri, 4 Dec 2026 19:05:16 +0900 Message-ID: <20261204100725.343988950@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-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 69a4fdc7baf7a..7c0f7f2a392db 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2042,7 +2042,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