From patchwork Tue Jul 25 11:21:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nitin Jadhav X-Patchwork-Id: 13326328 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 199A0C001E0 for ; Tue, 25 Jul 2023 11:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234439AbjGYLWR (ORCPT ); Tue, 25 Jul 2023 07:22:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234431AbjGYLWQ (ORCPT ); Tue, 25 Jul 2023 07:22:16 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2058.outbound.protection.outlook.com [40.107.8.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F6E410F1 for ; Tue, 25 Jul 2023 04:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QZTHEfK9ijctmG1ss4M70fu8yxfBj1tzJ4gKym2tkHiVrJ51dNmRCG9PoBPuxVp/xvDSE60gt0mgw3bu90uqnHtDIY+3Z5ZGrI8Cc26wgKsRC9rfr2ZT5DZ9xhTYOcstNZ2twpMnBqBg0kpVilEYuLNhaRd5Xeutb8QcYA2O98FYq2tykH8RFWiXCRBikVDrrwdqPLERdDwHvuFcfNJe6ngEI/Nj5/LKdWw3JMLPTkmbkNZ+QQx9+edpqOhuWyEADJWNbp8jBiWKbGKyNBJn37R8yRK0s4jrAq1N5XRwDUkfl/S72etYeWBUtxig4KElgW4FpANfKEqxUOSV6n6ZNw== 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=5e+kH7jbavEfXy2CI+FXctgAclZYu0bRugEzfUjGJ1E=; b=Baq0bIwoh1NibeGUnBZncjeINybpd0iwrUVorqIp4X/bMgxnwfKD5m7nV3HPyU1OfmlRqFIXeElGN2I2+jhMRfB+8bTgyWd+bK3IWNAbp25wrbCmlt+FzlF/KZmGbtgyawsHwrGj+I2YS+ccPmlooSPvTpP8+0upuYWA6YmarsFUYiJWzHzVuaLhaBiEOZLTeGBtbRwZd/tQBtFjIOoVftZZg2FOVIGsXHt7feIafR0WMtozVqch6IZ3dZptkRoRcpLro9qyiJvXYpkUgQs21Gb72kMHJzrnGEvghurHZPI0dSuRP8dTQxXqbzPnCxaKIPfv5e2O2jguEfUS8s1CRQ== 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=5e+kH7jbavEfXy2CI+FXctgAclZYu0bRugEzfUjGJ1E=; b=EKp/QdFJCK6hxolHZMna7A7arU6uJMQtnJYuPuQFZNI8f0IHdxl9LMD6bgd8mT51xq44mpx5RnPmFGvAXjNjTe5vdV1/CD5LsjBBikU+7MCIBdJJb+VgCQ/wfDFeFF6t9jgFAzxXJu1DH2I6/A6u8p4k/pMdctO9J+55bma9izg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB9126.eurprd04.prod.outlook.com (2603:10a6:20b:449::16) by DBBPR04MB7580.eurprd04.prod.outlook.com (2603:10a6:10:1f7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul 2023 11:22:09 +0000 Received: from AS8PR04MB9126.eurprd04.prod.outlook.com ([fe80::273d:f528:aaa9:288]) by AS8PR04MB9126.eurprd04.prod.outlook.com ([fe80::273d:f528:aaa9:288%4]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023 11:22:09 +0000 From: Nitin Jadhav To: linux-bluetooth@vger.kernel.org Cc: devyani.godbole@nxp.com, pav@iki.fi, luiz.dentz@gmail.com, sathish.narasimman@intel.com, nitin.jadhav@nxp.com Subject: [PATCH BlueZ v3 1/3] shared/vcp: Fixed the crash observed with VOCS Date: Tue, 25 Jul 2023 14:21:24 +0300 Message-Id: <20230725112126.49656-2-nitin.jadhav@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230725112126.49656-1-nitin.jadhav@nxp.com> References: <20230725112126.49656-1-nitin.jadhav@nxp.com> X-ClientProxiedBy: SG2PR01CA0185.apcprd01.prod.exchangelabs.com (2603:1096:4:189::19) To AS8PR04MB9126.eurprd04.prod.outlook.com (2603:10a6:20b:449::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB9126:EE_|DBBPR04MB7580:EE_ X-MS-Office365-Filtering-Correlation-Id: ab54e28d-1f82-4d6d-4328-08db8d016287 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0OkSnL4ixDdhDrOe8ctpCZf5WpualrVKivEaJZK24+nsu9rIodqstfRpebS/SEqvRG88k83XrNc72EZiU4TTX6RburgMFy/0cA4kdnTwW2ShyT6O/+PubbqHjZ9B0PhTqkIvJv1dNu0+Jq76iaZZxvxy+ZhzdJiv4IwCHI6oqvIu/q7VfmsH/Hetzhyf6WnJQpV0oddmgBstbm1HSNq0OhNyfPhVI904I8bdngKft1eRQO9OckC6eZzqCpOBP5Dy/UAZtC61z12g30IV4s5ulszfKPDys6wtFe/UOEyof9PVZwpMJqk6d2QY0tVqBotUiG7h3Ng3AvLdoY7eZd1lFMkOOI+REKYzdJAunExQjZ+05YSYH4RwtjM7IdFXL1fsguzAUgGjj92k3+Cy7hjGCMt02F+0HMi74PSRgcwu7V2xbcOAm+QvZH8GQO4pd5NTkHT/W8ZS2dJIUMqsCmRSxi3eLkq5ax2bL5ovtt0mJv5nhbeMc7F6thve5y/+CbOAhOiu6aF14jtapGoGwGdp7NWaFnXcmBqFzOkBHVKszxIvP1/JbxXmk3wHZNEfXquqB1/LldqjFUIXP0fYPZz7zq3ZVaQL6Qh5qh9Fy7p8hwgSp/rUelS+6IbnFIypDGoC X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB9126.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(396003)(39860400002)(346002)(136003)(451199021)(86362001)(36756003)(2906002)(52116002)(478600001)(38100700002)(38350700002)(26005)(186003)(2616005)(1076003)(6506007)(55236004)(41300700001)(44832011)(5660300002)(6486002)(8676002)(6666004)(6512007)(8936002)(66556008)(66476007)(316002)(66946007)(4326008)(83380400001)(6916009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: adUk+pYKkW39KOWL8ldgNGW3HuM4d/YoFSxARjRuhiF224Mk3J7bQ1zsHRAFtEoBxCcVhnCdbCJG/6p16BXR7/eVoIqUwOdZwSoK1EhVcA13KPmtPPJIFsuFlHKr3sN1U6k1kPDUmrLmuMQFF7CcMtpOx0GdOeFhKFqoz2yMM+GTCORJbbJxTV7pyWbawdawd7gWlJIWdNUDV74k1/8KvS4lJ23O9EBGpettIGfS28NeCvqP4WhfEn20wzt4XqfAZALvMU4Hbwnu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t1UzbDXyArWrHM4q0LqiuoQ2V7Vrq7YRcutFFO6JQoYyj6VDqzdr3nSt/3cDua11VsljmsbZKOe/+kXhxoD4xw8MKpSRJYhSLlD9trE5meJ0WGiZqxAXW+7x4cC7jt9gm1sIBzjBmd7NYjoNzYo+Khf8oBU5NIQXFPT+Y+St+iYCBq4+wLMtdimkyKB7ScQ675Q0HzeX++es4J8sFjv9WYzdCBG6NaAW9D4HLS9bsdi+MCZ7oBwxSFZSM0TPOTm5j X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab54e28d-1f82-4d6d-4328-08db8d016287 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB9126.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 11:22:09.3701 (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: LrmhGZ0GrbYf5C4nVDCQ6J8xnNa4vTMLCXN33CcM8ivaTEKUuRBFqDwseg40FRIy7WaHfpYvNhFO+CVX4tkjJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7580 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Root cause - There are two types of database- Remote and Local (rdb and ldb). - In client mode currently the code was written to access ldb. Fix - Correcting it, to access rdb has resolved the problem in VOCS. - Same correction is done for VCS. Reported-by: Pauli Virtanen --- src/shared/vcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/vcp.c b/src/shared/vcp.c index 74bd01729..314618664 100644 --- a/src/shared/vcp.c +++ b/src/shared/vcp.c @@ -1719,10 +1719,10 @@ bool bt_vcp_attach(struct bt_vcp *vcp, struct bt_gatt_client *client) return false; bt_uuid16_create(&uuid, VCS_UUID); - gatt_db_foreach_service(vcp->ldb->db, &uuid, foreach_vcs_service, vcp); + gatt_db_foreach_service(vcp->rdb->db, &uuid, foreach_vcs_service, vcp); bt_uuid16_create(&uuid, VOL_OFFSET_CS_UUID); - gatt_db_foreach_service(vcp->ldb->db, &uuid, foreach_vocs_service, vcp); + gatt_db_foreach_service(vcp->rdb->db, &uuid, foreach_vocs_service, vcp); return true; } From patchwork Tue Jul 25 11:21:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nitin Jadhav X-Patchwork-Id: 13326329 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DE59C001E0 for ; Tue, 25 Jul 2023 11:22:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234448AbjGYLWU (ORCPT ); Tue, 25 Jul 2023 07:22:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234426AbjGYLWT (ORCPT ); Tue, 25 Jul 2023 07:22:19 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2058.outbound.protection.outlook.com [40.107.8.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BBFB9D for ; Tue, 25 Jul 2023 04:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Br5DWa8zRfiR4T9kbpXwWiVacTOyy7MFM2cUQVYqFl5hgNzyLKabfxGMXfceAaDGHVA204dumskDnHWEyzfCToxqYYJe0FfboN0VvdGZ8zhqUww/0MfFFjnCzlX8bOWLvM9HIbH259XdtRup4sJz9MhyH3obwmwUgQElYoCdWGCnuaL+1mb74U2ABhqAHMXo5f5BOB9GP5JjeP70Xw8l3jMe5rJTxIbTBEJmY88EC/DnZNqQo8HBsdzXBxsobHgD0oR6lhb1rg4YDaHGZRnp5Df5hIHdcjjUltUHzQQCEL5S52Vof+flZq+eeusKZuYmQP+CUU4vILrjZmfCK1FmEw== 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=hUt6FM0CMI+A9Rzv8goHZNKcELhgXs5Wx8XW4aHmQFo=; b=OHYmWfQSDwQVoDGRUYNvD8KBsVfbKHVdGrrNrb46iQhudzHsxG+mSzb9g8hIL+Q+oPfUjYYrLx1nZeDRp4QYi3RukjTBOarchApamBHfzntE0a6IXsIE1z0OVCW9wJCUV+HWOkq4aUxYqc45Je0JfYbvdTRx09cKCKVt+cxW7FuS3nxrWJ8nHH/M9sUBFggxlO5fzK8PjHffR4WSAmgIEpgKBUVrgvI1X3YNQ6cC1HVXw0ST7twhef/7Zi4UVjKQD5M9ogaXbv4NxXQ0VfONC91JmQNMZifUC3Hwf52PT3ouXRXjd8G2yfgpExYobcuh05uXv551t9Lb7wWMxvIm3Q== 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=hUt6FM0CMI+A9Rzv8goHZNKcELhgXs5Wx8XW4aHmQFo=; b=S5BfMAAQ79nm45WY5yn4E42rNxrmanZTaOYqvEHTtLqsPLstZqcfIEIloiSweBKzIMeN6efdyw/zBPOcwccii/3Un6L9yX33fviPfpiEH3HoV/CdstEVaptV2PsL9XOwx9TYz8i1cApq5B5POQZuCQnAX+2OuvNcfp+2Tdww0XU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB9126.eurprd04.prod.outlook.com (2603:10a6:20b:449::16) by DBBPR04MB7580.eurprd04.prod.outlook.com (2603:10a6:10:1f7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul 2023 11:22:14 +0000 Received: from AS8PR04MB9126.eurprd04.prod.outlook.com ([fe80::273d:f528:aaa9:288]) by AS8PR04MB9126.eurprd04.prod.outlook.com ([fe80::273d:f528:aaa9:288%4]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023 11:22:14 +0000 From: Nitin Jadhav To: linux-bluetooth@vger.kernel.org Cc: devyani.godbole@nxp.com, pav@iki.fi, luiz.dentz@gmail.com, sathish.narasimman@intel.com, nitin.jadhav@nxp.com Subject: [PATCH BlueZ v3 2/3] shared/vcp: Fixed issues related to read audio location and descriptor Date: Tue, 25 Jul 2023 14:21:25 +0300 Message-Id: <20230725112126.49656-3-nitin.jadhav@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230725112126.49656-1-nitin.jadhav@nxp.com> References: <20230725112126.49656-1-nitin.jadhav@nxp.com> X-ClientProxiedBy: SG2PR01CA0185.apcprd01.prod.exchangelabs.com (2603:1096:4:189::19) To AS8PR04MB9126.eurprd04.prod.outlook.com (2603:10a6:20b:449::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB9126:EE_|DBBPR04MB7580:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ed5eeb8-7cce-4ab2-1293-08db8d016563 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gOv52yJFwwrKz3ob7ZQGkfhoeu5sXgjKCOCBPwi0D8TmieFtMefRcl/DIPzenPKsI6S1yNi9oAT0e0TWz+qqcfXXdCKAs+IO4d15egbMuiV5QzYAu4Z7dHrnZPx0xzwNRoRU9Yzbcv/Y60l65RICSZyd8uobh6MnTx1+wSAxwzG2cMZqo1QTY6NHEeiNA9D+njuzxszn31KaAcIAkJ83+yFsMeurg/cd+7ynW/B8+zoBVhc7U7LNQ2npZb6h77vb2vsp6tMFDHjTVPb2EDxIRNKdEYnNdCHBfHaW8v6UTPrAkVLSgAHMkzh+e9AmUiCi3p5ZgYdZ3DG2Kuz9eCF7TbCCIrWQyP5Qvc+iZKBTNWCgD3HFDSoj+UsPF5Ls92NCspv2KMA3hBj/f/o8AG7YPCrs7UyOszw90EnuQcSEp8QxoWOeiBGugSU7GehGU8cbW6NZ+YDE64B5JeicZcbsfRZqDoWRxgZ0yrlLWMdkco7N+t+Zzh8xoqYuCVsbA3pltr/NOqixi1hzjR5ZQToU5VHd9IfhsQFgRpAeRBQQdEh0IIONBMYGaSQRF8GG3grnQFAL3rMvFNX/H24/Myx5Zzx7Edvx7Gu1PSLnS6XkVrRSBnW3n0OoIyAoH2dT3pUm X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB9126.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(396003)(39860400002)(346002)(136003)(451199021)(86362001)(36756003)(2906002)(52116002)(478600001)(38100700002)(38350700002)(26005)(186003)(2616005)(1076003)(6506007)(55236004)(41300700001)(44832011)(5660300002)(6486002)(8676002)(6666004)(6512007)(8936002)(66556008)(66476007)(316002)(66946007)(4326008)(83380400001)(6916009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hpUcDeMYSN54154iOO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M5Jgvk/BWE8uxen3YKD7rPk+FTpWdxO3R7wC5RIqsj7VlO0HorPUqMuFMgKznvELPHFwWxrB3YcF7V9FeeEbUkN5J2hQqDS/BK67TAV+XLHmqxLj9ZnqG6PQxQBcQE13WUjelUI+GMFI2lEv+tZqwyKIdKJqbkans8okl1JyEo1JBK5JFBWBWdtbzhahxuWMHHV23Zf+GENzbVOipxSEAr8e/GjyYdGtqpBZ1e9yjrEs1PVqZur++oAsByWYaoPmCRsIb1Qiqai7ntEEgoohouMq8ltDxkim9djbkuspa3WRFhR2O7jbBMsnDjoMiNi9ct0Ije/dRSwLgVqncO2YJW1g0YgZL/3s5/FN/kxOCZmO9VNossgLNkHb/gFCbTm2VYvaMcmbhD2ZhNY80Ad/fyOwOR/BBLMAq/FjI8VafMUVNist01BPEWoyT4OvWDYyUJTDQ3Bzj80E/SMTaq0mDQesG22QRcfn23qv8e2snRSrZrd X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ed5eeb8-7cce-4ab2-1293-08db8d016563 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB9126.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 11:22:13.9425 (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: UEJET26YjuHWFR0SJ9SzN/Lx/32HqkW78Panvj0Ttbe3JYlp9F3EU54vbpseseFQGBvNX/pmtrAMQ13aXrT26Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7580 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Issue - Audio output descriptor & location read functions, requires code correction - During reading audio location descriptor value was checked instead of pointer. DBG statement wrongly accessed value to print the log that caused crash. Fix - Corrected audio output descriptor read variable - Corrected the audio location debug printing function - Allocated the memory as char pointer to the audio descriptor variable and copied the string to be displayed. - Corrected the audio descriptor pointer checking condition --- src/shared/vcp.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/shared/vcp.c b/src/shared/vcp.c index 314618664..0408531b2 100644 --- a/src/shared/vcp.c +++ b/src/shared/vcp.c @@ -973,7 +973,7 @@ static void vocs_voaodec_read(struct gatt_db_attribute *attrib, struct bt_vocs *vocs = user_data; struct iovec iov; - iov.iov_base = &vocs->vocs_ao_dec; + iov.iov_base = vocs->vocs_ao_dec; iov.iov_len = strlen(vocs->vocs_ao_dec); gatt_db_attribute_read_result(attrib, id, 0, iov.iov_base, @@ -1385,11 +1385,12 @@ static void read_vocs_audio_location(struct bt_vcp *vcp, bool success, const uint8_t *value, uint16_t length, void *user_data) { - uint32_t *vocs_audio_loc; - struct iovec iov = { - .iov_base = (void *) value, - .iov_len = length, - }; + uint32_t vocs_audio_loc; + + if (!value) { + DBG(vcp, "Unable to get VOCS Audio Location"); + return; + } if (!success) { DBG(vcp, "Unable to read VOCS Audio Location: error 0x%02x", @@ -1397,13 +1398,9 @@ static void read_vocs_audio_location(struct bt_vcp *vcp, bool success, return; } - vocs_audio_loc = iov_pull_mem(&iov, sizeof(uint32_t)); - if (!*vocs_audio_loc) { - DBG(vcp, "Unable to get VOCS Audio Location"); - return; - } + memcpy(&vocs_audio_loc, value, length); - DBG(vcp, "VOCS Audio Loc:%x", *vocs_audio_loc); + DBG(vcp, "VOCS Audio Loc: %x", vocs_audio_loc); } @@ -1413,10 +1410,11 @@ static void read_vocs_audio_descriptor(struct bt_vcp *vcp, bool success, void *user_data) { char *vocs_ao_dec_r; - struct iovec iov = { - .iov_base = (void *) value, - .iov_len = length, - }; + + if (!value) { + DBG(vcp, "Unable to get VOCS Audio Location"); + return; + } if (!success) { DBG(vcp, "Unable to read VOCS Audio Descriptor: error 0x%02x", @@ -1424,13 +1422,18 @@ static void read_vocs_audio_descriptor(struct bt_vcp *vcp, bool success, return; } - vocs_ao_dec_r = iov_pull_mem(&iov, length); - if (!*vocs_ao_dec_r) { + vocs_ao_dec_r = malloc(length+1); + memset(vocs_ao_dec_r, 0, length+1); + memcpy(vocs_ao_dec_r, value, length); + + if (!vocs_ao_dec_r) { DBG(vcp, "Unable to get VOCS Audio Descriptor"); return; } - DBG(vcp, "VOCS Audio Descriptor:%s", *vocs_ao_dec_r); + DBG(vcp, "VOCS Audio Descriptor: %s", vocs_ao_dec_r); + free(vocs_ao_dec_r); + vocs_ao_dec_r = NULL; } static void vcp_pending_destroy(void *data) From patchwork Tue Jul 25 11:21:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nitin Jadhav X-Patchwork-Id: 13326330 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA884C0015E for ; Tue, 25 Jul 2023 11:22:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234443AbjGYLWY (ORCPT ); Tue, 25 Jul 2023 07:22:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234447AbjGYLWX (ORCPT ); Tue, 25 Jul 2023 07:22:23 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2058.outbound.protection.outlook.com [40.107.8.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CD6F9D for ; Tue, 25 Jul 2023 04:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SUIIAlpvSPV2DoJPzyjsHXLDO6UdFIuhtKxzBibHSkLTpeO6f0oiqZi7RERgRSGCRyYYvNRMzAiCBzgy5+/tq3vtshTkkquFX45NjCsESMlSet0/nXkVagk2B6VAhlCpw/BT1bSlFN9W4lMyuWody3j4G+b4esepi15nFoJ6mux5XgJV79FNxxU5VuZ0fvP5hlB0OEG8+fAgoTWuDmVQvDSyIYoQlR7A0cpPdfYsRCE24PV79kQ4zo+uYytn0nrBQKXkeBYJVV12JXC8aLC6ZhBfh1zqKuhwRUNWek6GgKrRG9uNWV5l5Ce3qaMVf18ItZMiZDV+sIS0qBRtNprj8w== 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=kMN0ofOl+sZj5q0RLL6t0fC6AwkbZ99WnZfhN9SKEE0=; b=nbqd1hW7LB8t9qcpmC0u9YuCzBBGwKexZG5KjffAkYI2oHgKQzQOwHJqN4qz+E2b8IHMXGqVyVfLfAzB7XR8U0nrdhP8nYf3w09Xz4Hoh2GiSp6N/6WqhknQxW6N5JohBYlzsQ8h5If6wmx4EM/dhTXdKdWmoeRAnVOwzRCG3xFoe3BSCGrgYHh8kB4p/3LofW67e7k0kOjJJGynmCFEZGbKLwsLLNICziIJmv2dJqSf+7eICS7vWi84V/2BK2kCvybHZOjnOAj2enwfn2KFXqZy7MJoCUtVgn0t5IAA3e39iUleSwftwdEXvrDUjobc8kH7kLLWWHzF8ibucOCWpg== 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=kMN0ofOl+sZj5q0RLL6t0fC6AwkbZ99WnZfhN9SKEE0=; b=EV8R5qzhTG/Bp9rb7mxX+gu/w3tj867RnibdjHXdAi2SI9xcqXrH+2iW2+P7yFOSPXymUCDVIXMI6rEVItli68qHLy6HJbhAMNoASHVMaW8jOaYk/q0lzT3Mc8My9prsWCelS1rggucX3OEEcxgvW9wCF5fkHX0+jM7cM3YhrP0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB9126.eurprd04.prod.outlook.com (2603:10a6:20b:449::16) by DBBPR04MB7580.eurprd04.prod.outlook.com (2603:10a6:10:1f7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul 2023 11:22:18 +0000 Received: from AS8PR04MB9126.eurprd04.prod.outlook.com ([fe80::273d:f528:aaa9:288]) by AS8PR04MB9126.eurprd04.prod.outlook.com ([fe80::273d:f528:aaa9:288%4]) with mapi id 15.20.6609.032; Tue, 25 Jul 2023 11:22:18 +0000 From: Nitin Jadhav To: linux-bluetooth@vger.kernel.org Cc: devyani.godbole@nxp.com, pav@iki.fi, luiz.dentz@gmail.com, sathish.narasimman@intel.com, nitin.jadhav@nxp.com Subject: [PATCH BlueZ v3 3/3] shared/vcp: Corrected handle size to accommodate included service Date: Tue, 25 Jul 2023 14:21:26 +0300 Message-Id: <20230725112126.49656-4-nitin.jadhav@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230725112126.49656-1-nitin.jadhav@nxp.com> References: <20230725112126.49656-1-nitin.jadhav@nxp.com> X-ClientProxiedBy: SG2PR01CA0185.apcprd01.prod.exchangelabs.com (2603:1096:4:189::19) To AS8PR04MB9126.eurprd04.prod.outlook.com (2603:10a6:20b:449::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB9126:EE_|DBBPR04MB7580:EE_ X-MS-Office365-Filtering-Correlation-Id: 89deb0ef-8bb0-458e-c39c-08db8d0167da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2gX/sKz6h8NOPeENbL8lOa/DqymuRMG8RGuBgWXBDi97Z/HEgOR4a89+DrEuG+KjqnS3k46CxkXFth4LfsnVo/h4wN3JtfERDXCfBp8x5+yMAyLcFuReoVeeQjTsFV49rOXRgCLyNIT7e8mUX0YV1hj9qrOFpJTbtb41iyDpgPAG/u4rPvmjMhstIOu2edvXDG/fB6/YwLJLe3PuZ4u0EdWL15bJCHtzAX1wY7mILLsZbAbOdCOE7Uto39JdO0yuemoA78WF/+MRq6tKEWhWMQbWbGTFLnA6EMH6grdk6dREjGj11hRiwynHfDIii4nMTz7dOzNCX1dDLcpuvVIK1R2hiFrd2ozT1OxqLSvzaqFR/t0BxwCfFFyzBF2H0Aax2nv7zcLELMNYNLnZe8S7G2P2ybkPHHEGdUg7d60OXV4J7a+xpKjox1Bz2ktStU/B3WunXj1eAgVenNBJUA+M0o5e536Gopc0Q+1oY2judyzsw0e6YdXQu6Cg8g9xweJkSdezV0GXCBrcHkRFtOdhcjucTc6uGMRDYH9L6AcBl3MGJawE9cQb7u2QeGlgppTTPatfsYgDF56fNqzdfEcLOU1KGl/0EKWsh6UbTFnh9F+n7rl7xlRXsEKtcinKdFGa X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB9126.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(396003)(39860400002)(346002)(136003)(451199021)(86362001)(36756003)(2906002)(52116002)(4744005)(478600001)(38100700002)(38350700002)(26005)(186003)(2616005)(1076003)(6506007)(55236004)(41300700001)(44832011)(5660300002)(6486002)(8676002)(6666004)(6512007)(8936002)(66556008)(66476007)(316002)(66946007)(4326008)(83380400001)(6916009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ECw5szsJt6MYyQEpKL5v1iOjKP7Oa/riP9w9PoxP92F1FtX6WbW7f07+HyuiiB1vVLvNb5SrnbHmI/rzXiSMTkqebbPySLCP7WM22LrMQKZxnL+3yHwPcfqDHmjFCc4nYty2ZAVwRwXEN3zOuutsmmB40QYSfvXHNW9EtclTZ27FLrd3Uk0v9KfRLsaTWej+edi+lOJIVBmdgqXzSehL3DFjc3KkoHfYTAuOnb1snRhTy5XZcFRjve/tmdcaVgOT7yh/uYX6ZHHcvnejYEMJ0Cg/oMDHc0r54fnBAuJua6n4B34MB2uLlCKeMs2Kn653sIm3YQHZW2ce3wjFoW4SDVC/10HDllSHmJmcLNQ4VIMfXVOPcTEXwlY60YCIuE2tHCmppuFD/Tp3DPFMSouAcf83YJJOyuN23gebjZjciwQGh7WE/F+oEz6IhqLDT0FybKm70b8mLhrBa1eJ6GRfFtliBAwoxDRlukwQFRnmuQnmK/NI73E8HLVKnhIgX2UAp0v81PuoydntMBNYzpMzcEouo416yN189pAhqDWzO146/MyanO+Q6QVtUTlTobbwdUKT56sOF14Slzj9fowMHRby27wNBXxIljEFjn3Nuub63TETqmJKsMwQkhk32198769HlBIGvsnmwFEb83e41+z0a7BOgrjXwKowhYgEVarDpp2bN8dDD2jDvN1QMKqUz6qjsL1PRqZ0mkT0o0b8nHbSpCIVElWncFDHkOry3XclIJx5Bv6gURzZRwd5vw43G8hgcq0SyVsv2DLarotlbAqM+gj+YP1Mux7Pune2HEgfNizYtPustH1d55ipTQ/cZXJeBU8qfn6CNjOqRQXP18D6Ua8f1kHzhErOwnBkvgS2Ytb4QpTj7IjtXU2lHcqO8jQiiaQzMt/OlanV2LPqFNdUb+QaVRDfP1020YGvkar37KMVofTiH0DtJnBdvvNByb2r0N/0MvrGhVVWfyzoEom59K+P8rI/9hBBkgwCTKSkQFIsS9uT8tBKDtypP02XjvqHNtpRoGrEJfYgVOJsJeRz4oIwXWPxuP+tm8v9EsXppnVwnA72sO0QuiraBxPWXJzBDrc13yLZtCatrgfMmm7QNqd8KC0L1Sa1RioS6x5kKKsrlG5VX3j7tW0G6juI6o/7dK3EJ0BJrWLYKikWv61fj3/AtwudhpqTsyJ/6fMPDtqM/YZJ4V+HWVNRh1XgvNC8GzSBY5MVemST1e+lJh+DG8a37NaLvfCyqVPwcyBoXt1wh0HKXy+9/P3cWLkuEh/jeVaaTvt+ofdN9Sj6aSEOf8WEBCrE8RnAkCtvsdJS5U0hyN9gm6CGqApfqqGG/xGLUvk1KIp/xEBFJOjfUFlRvodJO0rMJOTb4l6e2OQaqWb6Iw/CkJUX0ts0Z/NzV56ng1WtT4JTbuw69HOlnoz7517DPhwphWTNnKDbe3KF2Qp05D4v2PXE/xtC3USg2UOkMarLWWAr4bBorIFNckQf2zdvtEetNiQjd86M8/sAayV/J3e9h6/XcFCiiYgAdlcYkWfm8718cZfXMzpXE++rqKvLpQ6c7VxB2hbcSS2HI4XMinurp8A53pda/tuf X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89deb0ef-8bb0-458e-c39c-08db8d0167da X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB9126.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 11:22:18.2856 (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: qIBYMOISFzu0GKYkY74L+Fb/X2IgJGyX5manLr7g0RxbvQ6N90fMQKO0tGi5plAcVDWdWTSJJ5dk1dbUuXOMQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7580 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Fix: As per specs VOCS is secondary services hence it should be included under a primary service VCS. Current number of handles should be increase to accommodate the included service. --- src/shared/vcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/vcp.c b/src/shared/vcp.c index 0408531b2..263da4c30 100644 --- a/src/shared/vcp.c +++ b/src/shared/vcp.c @@ -998,7 +998,7 @@ static struct bt_vcs *vcs_new(struct gatt_db *db, struct bt_vcp_db *vdb) /* Populate DB with VCS attributes */ bt_uuid16_create(&uuid, VCS_UUID); - vcs->service = gatt_db_add_service(db, &uuid, true, 9); + vcs->service = gatt_db_add_service(db, &uuid, true, 10); gatt_db_service_add_included(vcs->service, vdb->vocs->service); gatt_db_service_set_active(vdb->vocs->service, true);