From patchwork Tue Jun 18 10:33:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13702088 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2071.outbound.protection.outlook.com [40.107.6.71]) (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 86DE31459FC for ; Tue, 18 Jun 2024 10:33:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718706813; cv=fail; b=e0ZJQMd5pl2OY9kilQe2AS4i0vSB51tQe4oSc2yWcTX2JKCepPsJdcFJe5TAiGQzzxcGpoDM2R3+2WFl7MtOfbbSI+5qL00nA3jW91eGCAzseOm55Lef7bpmYd9jsGtMwWgkbC7DwIs8N5U/X/w3LPu4GVj4FQvf2YZyOA9/DMo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718706813; c=relaxed/simple; bh=ERIS6gW9IWfqJ6+qiw81tgqgFARGLoTojZyIZQgGxsI=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=duDl9hi/6OtYpqMxMFOR2O6Pw5Jy6QdKe8Kmel7y0HXiZCLT7M343EOOPeRq/C89IuKOwltkTs5DA5BcV/lhnJ5jg5YWa2Og4Xv0ysGHZFMoa1GEztwXKERFlOUKKKa3lzSw/bPdv+ubsmmViKVjKuSfrvvgqkw5h3tbMl8e2U8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=ZZbbtKgx; arc=fail smtp.client-ip=40.107.6.71 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ZZbbtKgx" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BxfV1jA6tniCFx1uCe7jia1ukao9yxtRuAGfiaN8bbMOZygksys0Zt9CQr8E8U+cKonPAWLBe5pvMu0mcLVRgmTOXRrfx2tOzpNfbCzjA43s+aRElgaVQlBnggxV275vTUI8sIe1buv3i3oOOHmeRzXpq71YczNrECW+OSaQXtj+k7za50XmS2PczxjXwZfeme2Z05goBW+9awMPzmXbGqy0fsKnasWtkUbMYgw2lzVetdnEO9/2cjxhpnESVdBaFf2p+sbsK6KOGy4Q4T6gByQsh1YO/+oRqi/n+8IKAk0vFqabxMUuFb/fbRiIAMcSxBxFiF79ZBnTxeUYWYO51A== 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=3crIMLrts8yTnfQKI17QP5grHqSnJ1CsBP4O4G2Fj7Y=; b=UAD+ZFUw81kE9RHbcTitAkq7JDDG+yPe2ViUaBEaa9mtPkP9OII2vlSfAiSTjiJE19V8JbTnfvDM2ckI/t5o1YjVcT7EL2BXKeJeevZNkj5kxrn2ex8jfhTQHRRcaDcZv69bRTn96COBHyXYNi9YSmUUYxa3LthjyQWGUpraGRAnzTodZ/f5gYz7duyZltqBhRHUtQh0S9mJ6tFplv8zRubQPXtmrgyQ0O4T8Q49245m5Pgey4EnAia5LiBOgd4yfu11baLUswBXnMIGGDrp7sWUUGMKquuoqqbeHmu+wB+IDbUTi9Uj86axu8YQnNeqNPN63QwJBrB2JjKE1xc7TQ== 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=3crIMLrts8yTnfQKI17QP5grHqSnJ1CsBP4O4G2Fj7Y=; b=ZZbbtKgx9I2ChDHhzOxangNQYFpD5wTG8Qlwodz+gYuUlk+wLIMG6G4scO1gn/uobVMCLJ2yuLu3/G/pu1HpriixX2pPrfXYS4Dyhpn+Zo83mvKWmKd50hoaLjTpxgMNLuYduMkfnSnwRcU6gWmIuulKhPCkT/fCmmXaZDFmMHM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by AS8PR04MB8723.eurprd04.prod.outlook.com (2603:10a6:20b:42a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Tue, 18 Jun 2024 10:33:28 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%5]) with mapi id 15.20.7677.030; Tue, 18 Jun 2024 10:33:28 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH 0/1] Bluetooth: ISO: Check socket flag instead of hcon Date: Tue, 18 Jun 2024 13:33:23 +0300 Message-Id: <20240618103324.15645-1-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 X-ClientProxiedBy: AM0PR10CA0110.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:e6::27) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) 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: AS8PR04MB8898:EE_|AS8PR04MB8723:EE_ X-MS-Office365-Filtering-Correlation-Id: 59e12af2-ef51-48ed-3da9-08dc8f8217b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|376011|1800799021; X-Microsoft-Antispam-Message-Info: f2LbKHHjweQIFj5tMf4xHsB80XGcFKtNa3qGl1ZrZrmOjGsdvSjSaj7rK1ai8pO4eKWYsy1TJn/xrpLKAUp+ApC6HKYUfA0zce9IXh1qVfGHnghKWhu8zxJfYVuqBVbGPFwMd1X9IzyRg1LrvYozU9knjzPke8VAjEQQ/tQk177F0LTVSS3DdoQfE43b63M/KncihQYcEaFMMWXFlp7KQtwrwQm7F2nyhc3Hl1YEvAOeyK0kKfEnsDzXNPgCLn3apn4rNfDkrkVvkelKBxLyGLNn1jIlntSnL0qk7YSFcCAzYaH4nhJR5UfayIMnbh7521kPP6jnUVrArVIzjKH1t3m9wiz6EHnRoEGxFfj7maXPlrHnaMOQl1+qyWuBLIYt5/pa/nGBkSE8/+0x6WMRqMXx0FwJO3ZineuaEDDyH7ljSFdFARwLRLLTskdLersuZ7dKxxIteraxHkG1OJ6oDrGicGJz5XJlECwX7CbiNwLrPLp3l/azE5LaRa/KgqsAOPk8OMDfjM+I6DzY2xESAOghOZykzx7hwMEWzCEvreePkyIB9nC2ERulGOx/1GJJRxo62KkiTIDtjR0Mv0GcLsnUanums3kJ+QcIuel4BUbS5wJ1y94/2wv1/XOju/bCeTlUxA5ovAFusuaHCDYjJo5tBcqz2ivOCCSEzZHPYcNpCin4tpAR/bnATJmF+XlN6tqN25LrYio29euO3gixSu53JDJBmI3tDD16q5XU31ln7rnVL3CfkT3kO7cLTUtj8I9nGqJf1LlSX9+5DrUgfVLakDebgjNcG95AM59r7R42Uch7vm7lve/hrEZcQpGP1DWm898kaFDiFv3f7RGGRQ3/EQsj1+Z7+qFKix7ahTXzM0fd/Uvbhh7wPqLpDDOz3QN3twtWlFeV1EeVimQsvNA1e7CTobsbCZEYKVu0bYo9XSTPApFvGKsf70N2U3YlEYhhaEW49NcjtaV4iaImanOYsgykmlVj1dYzXmlP6+TtNMFpID7m6GTRQbHViuqO5QFvHNuT4tPRYgSUAZsDxhSoq7mNEv27hJmUB9t6NG9OqgSNgMKOcfRy+jGV+zZzQ/KOhSXw/Ji9xC2Jk5FtRjlL7ETWlrpYxjl0cEk5GTq0SE2CVem9lesaEKpD13yBPYuX2Ov7qD/QS0bNboMvCewO5iNsOXWFgaEp0bXzdJmPu8L60nUDVhUf0ebTmFsI8gzvDZJxUgkVOEp+lQbYPGALq4Stogvey3GQ7mH+bN7rWdEA9pJmOrVmZIiNFpjKRnMGYVFDZ+EXuFkgE2GXskruEqBs4OUE90UelaEeuL8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8898.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230037)(366013)(376011)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IgF13JtZhcrHpWQh6egqC63cDk6IGtsI65K/caOSqGzXa17ELU8GbnNSr3FMjPcYtav79uye7GaxeZkksMHg3VHh9wtuETNZReIGM5wH9jF0uFxPcuLSAMJkJfAOJz3J33cWLnGBSNGNQT9P7BRKP94oZkBZC4BiE/QMJPdDU2K28Hz2TwJK60xvucPlX5RCwtTB7LTV0ip0DSLCMCR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ITzBXQB51mNgiEtZYVtjMs8moqFjxlDuJTaCYF61SJhKO7jeDxbvzJBHz2DYgtMRoA/C+BUqVUd2iMQ9epnrSrXbgKiHm/EHCxPSTqQqc+eYKQNnDf/G4hQHDQ69pVzHYvHi/lbNKt4nrsYZzq2XzKaMwC8pLEl4vNlkAfH+uuTlSqEUs3ty3o75iODwaq7qB3zh9+uTEXV7YbE3QnAXBQQIC6VD97anDpYP0I6/IguSitW8nXvgoUDhhzdc6ovUwQQcMz25M5mLcQKTndKmuJYqq0nBGnDYtWpWd5bHioOd/QGHVMgRzgrCNL1bkvXjM+guIuJZ7reONM6WnZOCBg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59e12af2-ef51-48ed-3da9-08dc8f8217b1 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 10:33:28.6537 (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: 660ydWLEIm0Zl82nEKfmJgsTqHbJee7muYUcTUaZmziiCBzUbYbAeNxMbcaIM2LFQfxfwTAV1n12o26dzHAR9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8723 This fixes the following Smatch static checker warning: net/bluetooth/iso.c:1364 iso_sock_recvmsg() error: we previously assumed 'pi->conn->hcon' could be null (line 1359) net/bluetooth/iso.c 1347 static int iso_sock_recvmsg(struct socket *sock, struct msghdr *msg, 1348 size_t len, int flags) 1349 { 1350 struct sock *sk = sock->sk; 1351 struct iso_pinfo *pi = iso_pi(sk); 1352 1353 BT_DBG("sk %p", sk); 1354 1355 if (test_and_clear_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags)) { 1356 lock_sock(sk); 1357 switch (sk->sk_state) { 1358 case BT_CONNECT2: 1359 if (pi->conn->hcon && ^^^^^^^^^^^^^^ If ->hcon is NULL 1360 test_bit(HCI_CONN_PA_SYNC, &pi->conn->hcon->flags)) { 1361 iso_conn_big_sync(sk); 1362 sk->sk_state = BT_LISTEN; 1363 } else { --> 1364 iso_conn_defer_accept(pi->conn->hcon); ^^^^^^^^^^^^^^ then we're toast 1365 sk->sk_state = BT_CONFIG; 1366 } 1367 release_sock(sk); 1368 return 0; 1369 case BT_CONNECTED: 1370 if (test_bit(BT_SK_PA_SYNC, Iulia Tanasescu (1): Bluetooth: ISO: Check socket flag instead of hcon net/bluetooth/iso.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) base-commit: e3203b17771757fdcd259d6378673f1590e36694