Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1918501rwd; Sun, 21 May 2023 08:52:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4dJ+XzPW0Wj8+lBnhurv9NwfntSSds3TiIYpuFB0dnotZLBFjWF+RPi3pz4LlcSvB4Twtf X-Received: by 2002:a05:6a00:18a3:b0:640:e12a:3a20 with SMTP id x35-20020a056a0018a300b00640e12a3a20mr11616681pfh.1.1684684329412; Sun, 21 May 2023 08:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684684329; cv=none; d=google.com; s=arc-20160816; b=dGCZgBwkhQ68NLc4LPskv7nU6Wk/aEDQgLemwqVZV0x9aMyLujiUGsqfIhTPI3piUA g9MRzfrIGUemsHrWMZ8jhrOG34wTquPEwEinGk7niRCSFtoeYLxTPwQKLfO72E39RC3a Q7jzUc8bQ0fGTOiTQZoK/Y5TA4gsAX0NvXA5168LBQi+8CscOk5kGVADYyTXQo2bWAAS aUjFqx3b6tv6YO/oJQSM2fw/dT1DdHk0Q59m3cWLzpEXF888tRieimwRRbrHCS1V6Z1Z qsr/A2yLAjjJDTnOLppg4lWZu0AKy/alGUP5eOyixTqsCIqDSZ4s0E1Rw0s4QzwPNPsg aRiA== 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=QBxA0jLW1sN5OP0MVIQi1IdkRlvFiHX18Bsa9pPjL/g=; b=nRbCLfwkKuqpe5Rd5I+1x7L5B6d3/iul6rij+v/QxseH74hlAjM4uKVw7gF0YwoO5o GNFpt0uLIIyS+EYYVh7MESZprDKbtSCO4rfIvmX+Vce4o8BHQiugdlXG9WOLThbo9ScA TZ2z/FR+BQln3eFZ2IVWWKn/MyJdqlxndHCRrNyxtZwYjgL9Sg+olku44QIcsqDq5BP/ J1RfgC/TA96VWg1K5HBmuSJarFEOisSmB13DHO/gdPDKtltImResG5Ig+GKdsS27gwYA pzPmpdYIJUsHK+7chz8FhUhNSuGJ1Jkcu1a/HV5UfQrhEPB1A48tghgZh7f4CQzBogNd 1Ydg== 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 n24-20020a638f18000000b005208c4fa34csi3211258pgd.773.2023.05.21.08.51.51; Sun, 21 May 2023 08:52:09 -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 S229901AbjEUPsm (ORCPT + 99 others); Sun, 21 May 2023 11:48:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbjEUPsk (ORCPT ); Sun, 21 May 2023 11:48:40 -0400 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C1F4E3 for ; Sun, 21 May 2023 08:48:39 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id D4BC4240103 for ; Sun, 21 May 2023 17:48:37 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QPQ3T2tnqz6tw1; Sun, 21 May 2023 17:48:37 +0200 (CEST) From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH 1/2] Bluetooth: ISO: consider right CIS when removing CIG at cleanup Date: Sun, 21 May 2023 15:48:28 +0000 Message-Id: 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. --- 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