Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp472536rdh; Tue, 19 Dec 2023 04:49:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IH9ijzK+t9wy3p0+uc0NwIxAVtqBR18W6ztk3jjSIBFAmKWlD1WMNK8FutiPely/kpgXhyF X-Received: by 2002:a17:906:49:b0:a23:f50:6cff with SMTP id 9-20020a170906004900b00a230f506cffmr4849369ejg.111.1702990197984; Tue, 19 Dec 2023 04:49:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702990197; cv=pass; d=google.com; s=arc-20160816; b=lEfeZ1TxUOoD/fM28UrOt2o2xyo6lUQ1TKbta0O+gJqGV6du5bH7FNZi/mu1ki8sRt yIAEGLSWwdCbvwJshV4Cfd8/8rnmAS+hWv5N0zhnIpI/yDUXQ71YvXw+n06OyAii+VGU HW2PKxXQpjmLe/sIL8dbPEwUkLhvtO8EeLRzNuMEZvwIxC/1E4BHCg2ZoKL6avsocSTS kW6ny51J3/H5DVJB9DnLBXtHm0Hq9WXu+Eh4RxoRciQ96VFyot+7RSTfNn2XS9yULN2k c5A1oDY8kRlA+BrBAaF+1cpOeuPvs/rLOCvSxNqFQX1bzhZgrUJroQUzEhPDCuAysp+T Wr9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=WVBHxrSbQzCp8ALuJzyoQ+D5hThsVt0OWQvTc5mEgPg=; fh=dNeyhZHnpfEyZCMyfArFhpr7HCmC7e6TeGeaWzLZcWs=; b=bHoENY5rU3G92L5DmzdiQWdvASjRo4iZ1H7t591sfp8Cx+npxcm8v6MupkWdrmpGQr LDHwDOd931NyGxxsNFBiwm1exeprBeBMc7H/b9rJicL/+/KhrwFk9/Nvn4bC1e1C6ke7 ndWfK7rWFzOBIfkJnLCTAAa+RjX2/e3j45SxzVHngGYANBJRlxbYN8ISHTwtny4DJ5JM HuUuclryKdiQ4olwgx+1ZkfZdZM16gLCXLno41GMzjzL5iOY8FYsDLquFhnSFY2Gr3GQ BqAq52diYI+EvgRVStQAUeGhuPVG+8oJgnsPu8XTQedpcnu9fZ4qJ9DfSYypPkXG+EGl GCiw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=FliUPHrq; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-bluetooth+bounces-659-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-659-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id qu12-20020a170907110c00b00a23588a95e8si1698418ejb.858.2023.12.19.04.49.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 04:49:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-659-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=FliUPHrq; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-bluetooth+bounces-659-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-659-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 92B051F251F6 for ; Tue, 19 Dec 2023 12:49:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2708318633; Tue, 19 Dec 2023 12:49:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="FliUPHrq" X-Original-To: linux-bluetooth@vger.kernel.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2048.outbound.protection.outlook.com [40.107.21.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B575E18629 for ; Tue, 19 Dec 2023 12:49:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hoX9pak3aDC0s2av7ATFI3aB7fsQYHJj/8hkP6utDoKRGgYQ7ziMhWFyus5UUWC3LecdMS4rfVjnbcp5nLYRIMqtHrpneacBGG9LTM/ejZVYRVAfER9Yp1ij/Lm+LLXs5Qv19tQbROE5ZGqGR5mPFiHWK5GsDafbSys+/J/AeOi5Qcrx4xWgjblk8OsgvJUtmg+SqRsMBrWjhBuhpQ08pGaZPHP6KXGiJFXLk+peuzH0yhKGurCabWjmv3QOv7efk/pIjw24ycaSCZxkmDYGtQBHXjJRccnQ/yGcfCXToiNtOXhXlOfrwo7WliwM4mIk7WOL2rq+/mi70yeB585beg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WVBHxrSbQzCp8ALuJzyoQ+D5hThsVt0OWQvTc5mEgPg=; b=m97xnZGg/OGclIuHYb0+/Vcb0vDJRIRHSb73UFmXTe3driDsubt/oKm5qi+LbRkgN/Qf/9bLbKLiazOGPd2k4f23obIDf1vCPwmd5Xd6H4YqPiA2M9tU415Ao0Iho8nE8mRT+qWUolbz7a0Kl+IrJg4oua0+iKDABTs1qenUb03i8wk1NqfQtZJ1RHVHLTWm4To724vuPcsrjBm35/5/lT+Y8MaK7YvixXzltcBJocDEQedGcsEiS0hc5PL7f7rm2yDnvDWTSBRKUHBo+l1O0Cs89RjzBC2jkXLl31wnm6G+Kzsn/OIdOrF1CWyAowq9tew0wAfQswabk2l46mzAyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WVBHxrSbQzCp8ALuJzyoQ+D5hThsVt0OWQvTc5mEgPg=; b=FliUPHrqHUtTBy4T7CSSRpZYseBzyu/XacU0v6a14Y/iHjzT6oWQmcNfltg60WBIcx1N5fVOcDWQvGsBHwHO0UUfLGJkaVwNkwbioP6voPt/n7lo7fZwnMuIgCibz+a2qVGV0SXuJo49eUPcHCPcWNq0oFjuNDUEc26rWrvGWa4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5214.eurprd04.prod.outlook.com (2603:10a6:803:62::21) by AM7PR04MB7110.eurprd04.prod.outlook.com (2603:10a6:20b:119::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Tue, 19 Dec 2023 12:49:48 +0000 Received: from VI1PR04MB5214.eurprd04.prod.outlook.com ([fe80::396c:f971:9798:7280]) by VI1PR04MB5214.eurprd04.prod.outlook.com ([fe80::396c:f971:9798:7280%5]) with mapi id 15.20.7091.034; Tue, 19 Dec 2023 12:49:48 +0000 From: Vlad Pruteanu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, iulia.tanasescu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Vlad Pruteanu Subject: [PATCH 1/1] transport: Check if transport is bcast before it's cast to bap_transport Date: Tue, 19 Dec 2023 14:49:16 +0200 Message-Id: <20231219124916.44173-2-vlad.pruteanu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231219124916.44173-1-vlad.pruteanu@nxp.com> References: <20231219124916.44173-1-vlad.pruteanu@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: ZRAP278CA0010.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::20) To VI1PR04MB5214.eurprd04.prod.outlook.com (2603:10a6:803:62::21) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5214:EE_|AM7PR04MB7110:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f991a21-dde6-402a-0a5a-08dc0090fc39 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y8Cx1/5NJjY+Y6mrlo/8ZXXRgqG70kO71m10PZadlorTEViiTq8ic4JYeXGfGty0wPBUs5Suxr7bTohQpgsc8+mISR3aw6DhtKwO7ZXZd33my9Cc92LyPsA83MJYkbn+RKAF+u/lIamCd+3akKcJsNUXxP47RMRa84AAtF/gRXYdPfkc4nAslyLDHhdi+imbrjLhntHwyp5u0NUQ76IcnRNZN+oMs/KpPnlPSE6HpWEjaE8pFHU9GBQN8nV7Mtgb6Tt8d9bLw2/J1dCvVcDIwlr/NptkS5t0WErStbXZmHCmNOGnPeANkiOtzS9ciKU4ifi+/UtO/xO8hz+AEkzoCwB1qlelNwOzcT/vrirtJzACBPf01z7Pj4hNzBmquSje+EpnE1uJoMyX/U6NTZSX3ppv2Om+u1oapM8Mn5v/fKrsLpJMymUcHEM47DutLPkONWWFtIKLaw+Y6IG3VhDMqEeg/ti1YUj2aoEQ+bdsA9VdMM71f5LRzu1a9EyPWy3co+VEpAQMXNJBP86hW8ZwaitTDQdHscXFY4qmQtmtNGMTuK7tAVK69UbROEqff4D8m5eFVIl8NfnHuEhyT3nx7NMBsYm0uknmrT1UZGftLI5iEQJMTL1V9TB50ZRaEJA4 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5214.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(39860400002)(136003)(346002)(396003)(366004)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(8676002)(8936002)(4326008)(86362001)(316002)(44832011)(6486002)(478600001)(66556008)(66476007)(66946007)(6916009)(41300700001)(2616005)(38350700005)(36756003)(5660300002)(38100700002)(2906002)(6512007)(26005)(1076003)(52116002)(6666004)(6506007)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HqSKz7h8okUY4d4DR/63os7kPhHWGRxp/+R59JyR9aJ/3NEz5fCG0GWroRPO?= =?us-ascii?Q?YbCQIN3jOPymgP9PrPjbISEsWnVloI4e9AlvFznEqw2wQ+hboVPJkCr5GgA4?= =?us-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ZWCj3cYlRTWPv0ta9T/OpfqDZZD+?= =?us-ascii?Q?z/c/vP/ytFBWX5RS7co2/YxzDzo0CFbiMb+cDCFZwSJsNXNzNbIsAMtrt6Kx?= =?us-ascii?Q?2lkOoRHYMNyabDPhRSecyiinrZmZ8w1KaHcVo1CtGcRgLGxy1S7EIXvOxPrm?= =?us-ascii?Q?eaxHKQPlEdFg6GNZLkYNpGijbVXB8NdZ8Q/LiK0XA3EJmmC3Nd968CZKwnB7?= =?us-ascii?Q?gg251tFwhaBBuk34TCnoQ0GeG8iKipZWZcwDtCofmLi9M06xnxXLDjUGaDIe?= =?us-ascii?Q?GHM+3jxKaTWKebOu347VbIRoAkAkfZNLBHvbqrpRHQqG6H+UKROOd5xR2OHC?= =?us-ascii?Q?NZequJI3x0g4s4ofJLoL8XcWuAKjp+DQzZ5XqSs+QU07lFixrCIUPURRURfP?= =?us-ascii?Q?Eqyc+QQXYDTBpp3exqT9ggv8zVM0HYZ9UkKvyiFHEpoE3YZaFCaDtqfT/7BK?= =?us-ascii?Q?IGDYHXfd0uuOB38JCh9FDXd+iBAdJTFHbQBCDBkFiMLbejLPU24wg1aaCsiS?= =?us-ascii?Q?cMMOCyVlnvEl+NgGbvpATHnHDeSZNYym9xHQ+eeETAZEOBWXCQZ7WVfruCjU?= =?us-ascii?Q?fWNuPiKBjVFWs5sFpoSKbMjVmt9k0tOfx4nDn3t2?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f991a21-dde6-402a-0a5a-08dc0090fc39 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5214.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 12:49:48.8519 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EFRoHeFKNWHQn1Ercv/CVK0QOaybaDIiPMq4KZwkhvCHSB3WbLVVo7jlTDbMJza2L/p4LUU8+qVRiPytaJq/qg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7110 Currently, when a transport is released it is cast to bap_transport without checking if the transport is actually a broadcast one. Then, based on this cast it is released. Problems may occur with transports that are not broadcast, but are still cast to bap_transport. This commit fixes this problem. --- profiles/audio/transport.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index e2073451c..555da99a8 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -643,7 +643,6 @@ static DBusMessage *release(DBusConnection *conn, DBusMessage *msg, { struct media_transport *transport = data; struct media_owner *owner = transport->owner; - struct bap_transport *bap = transport->data; const char *sender; struct media_request *req; guint id; @@ -675,9 +674,17 @@ static DBusMessage *release(DBusConnection *conn, DBusMessage *msg, req = media_request_create(msg, id); media_owner_add(owner, req); - if (bt_bap_stream_get_type(bap->stream) == - BT_BAP_STREAM_TYPE_BCAST) { - bap_disable_complete(bap->stream, 0x00, 0x00, owner); + if (!strcmp(media_endpoint_get_uuid(transport->endpoint), + BAA_SERVICE_UUID) + || !strcmp(media_endpoint_get_uuid(transport->endpoint), + BCAA_SERVICE_UUID)) { + + struct bap_transport *bap = transport->data; + + if (bt_bap_stream_get_type(bap->stream) == + BT_BAP_STREAM_TYPE_BCAST) { + bap_disable_complete(bap->stream, 0x00, 0x00, owner); + } } return NULL; -- 2.39.2