Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3443402rwd; Mon, 22 May 2023 13:59:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4gCIIqSFyxbZfd+C5985cCHaohBKus5vbUEvFyWtai4b1rZZVQjzHP+XHIstJ5YSEbxoJW X-Received: by 2002:a17:902:b410:b0:1a9:7ffb:5ed0 with SMTP id x16-20020a170902b41000b001a97ffb5ed0mr9965055plr.59.1684789157592; Mon, 22 May 2023 13:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684789157; cv=none; d=google.com; s=arc-20160816; b=hCkdItL7hD9ktmwqBSEy0u5G7bKWEkD6t7iUIBesRFBsOjC0qphgMzs1MnKX9+oTE3 a3pp1ipyOCKme53K34NMev+G+Omwy2kkPUZXIMRSBJWyu9bR/5527i9UYwG1CCazOt9f K0YIDOYh4sSRnTKH2CBfyd187nVjMqQoGlyGwyqHJl8OKckgElsSFU8+j7Eq8uMbooOn PdAu/0Av8Rz1sUPqLDsSNkoeKsMf4hSsXsBEMXcXP1gpEFl07zMbY5GifbCe+bdaLtWK WVaqlktvdV7EC8oukTVUYK1wKATzE+/pXXtiIPP/UUjbxGUTPhya/8XqW0WbiI3KhZCj yo1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=n52KPGx2zxqEdEfTqxjvB5PAZuizig+TKR9dzA1xi5c=; b=XCUsymPPBIwg4XiJB4RXEOtFsxNAc8sPGHdncuD75HNSDw7xgqHOOugvbgQNe/gM6n EpXgNL8pdiokxeLh2WrolLKciCV7bZzJBDct7UQRYDMtihAPXXTPl5DdwaawofsX/ZMm F3sHaQ/UkjtgJt0Horb/LqrWWzNxWJYJmmp0ID5jd4OP1ZGfnBeaKPie7W7COKVFhbf2 W2gt8SCtlJ5mehrVwq9lvKZJHEd7f2Z8AKTEHb5RhgD6XushVNowtGowZb51nc90ERGS 3X0fBG73KNar7JCBgpVB6WyzjpqTwMXjFEaQa0otWJMGxiKhoLxUfd0E9k4Ud9cEoQ2h KbiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m4-20020a170902db0400b001aaf4d2eef6si63480plx.370.2023.05.22.13.58.51; Mon, 22 May 2023 13:59:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234008AbjEVUwy (ORCPT + 99 others); Mon, 22 May 2023 16:52:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233790AbjEVUwx (ORCPT ); Mon, 22 May 2023 16:52:53 -0400 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DE6D94 for ; Mon, 22 May 2023 13:52:51 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 98B27240037 for ; Mon, 22 May 2023 22:52:50 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QQ8m05S5Lz6tvt; Mon, 22 May 2023 22:52:48 +0200 (CEST) From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH v2 1/2] Bluetooth: ISO: consider right CIS when removing CIG at cleanup Date: Mon, 22 May 2023 20:52:44 +0000 Message-Id: <2bf70b0560375b50180518968abd8c4dfcce7f34.1684788145.git.pav@iki.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NEUTRAL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org When looking for CIS blocking CIG removal, consider only the CIS with the right CIG ID. Don't try to remove CIG with unset CIG ID. Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections") Signed-off-by: Pauli Virtanen --- Notes: * v2: add forgotten signoff + fixes net/bluetooth/hci_conn.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index f75ef12f18f7..2363477af89d 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -950,6 +950,8 @@ static void find_cis(struct hci_conn *conn, void *data) /* Ignore broadcast */ if (!bacmp(&conn->dst, BDADDR_ANY)) return; + if (d->cig != conn->iso_qos.ucast.cig) + return; d->count++; } @@ -963,6 +965,9 @@ static void cis_cleanup(struct hci_conn *conn) struct hci_dev *hdev = conn->hdev; struct iso_list_data d; + if (conn->iso_qos.ucast.cig == BT_ISO_QOS_CIG_UNSET) + return; + memset(&d, 0, sizeof(d)); d.cig = conn->iso_qos.ucast.cig; -- 2.40.1