From patchwork Wed Dec 4 12:28:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13893667 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2062.outbound.protection.outlook.com [40.107.20.62]) (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 EB3521B87EE for ; Wed, 4 Dec 2024 12:29:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733315348; cv=fail; b=SaAYXcK+5z5mKnuhiIMDFJ9tcQOMKtAN7eVldnVhcuekEYsdUFsie3LW6GLZ+t97RmSkgNommO/Yc2GOBLJVGJm8fBpLoP4ypQOeK/Cvd48Mv7mLrv1Q/7X4QuDGe4wA0MnDip/frQI8HB9Jf7p+TCFrdHlVjZGjnS89lzeFOuk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733315348; c=relaxed/simple; bh=xulDf6KkoDyIuhMIJb32+CdTtEy2VX5BODZhivQXppQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Rn326um2jhbGCtE8ykD4VCCrVECzS6OMUlIJoGKO8qBjYpFsCddmxZBAIKJKcWi82y7L5pcsedDrrxLlK8S1jZy8I6W0r16cttN83IoLfOnl7ERArEqEYaU6sonTgYNTc50mj4FSOFN+2mnRABspoYtxIRS8rQs39T6drWzKa0I= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=kCmlz1YB; arc=fail smtp.client-ip=40.107.20.62 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="kCmlz1YB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oVZEXfSofSlv07nVmUAGHMmT2d8Vm87azZ4V9mVH9DI8kPgyJqkWk9QXfO1mOc44YZbSPkCYkrCbyJx67wWBUyGUNwR3JnJDZlP20ueUeIKwnIiqDSwJUReH/COwpcmksEQn/98BV/jb0MJW9HQMG+SpoSRjU9o34gF8BUbNkmfwoK0iIhMYiyy+PYGNcrb1VSlOWcF0XAJSzbIQpi4Qn0AuIwOXBopKkX07lg6cMLD1CNnzEI4qzzpJgN046gU2f5Ojea2A5Dopm12X9d+6x1qzO+y1T8p4u/Da05+CRokZrKlPsx7MlJZyaJxM+vl+6PMAiirkgT8RUe+HLL5vow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=5WgwJD9I4tM20m0QPM+aPwj+T+FWGadm9j2m4AN3uJM=; b=kxFJRnneQKe6qkFHoqc8Kw/0AIhLxbSbfc/t7f+xU6o5TIMx+EWuJ5KahDQSUhQ41eOQ8OAkSAgys1XHuhoh8q5MRj9qLvoct1Ub+/6HlAAB/n8KuXReLaWwqTQaYc0hwO/ZdnwL+atMRUAy5oWycecbrL33ubI8ifEPQKZO5fodiM6+ww/TV9vF2oMSo5IMf8+QqKuGHb8NTe0om34ZiAlQTt8FWUU96pq5IAFf8ANjh1ZxYX1iHeDPYmxpmOstXJAD52uJBBV1tmAchMDy0ZtdV6JOqaEkZRTjbWF3TV2ifC/3A7SFxmOBD/PSx7D6fODrlB0nMK+bPISac4fw3A== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5WgwJD9I4tM20m0QPM+aPwj+T+FWGadm9j2m4AN3uJM=; b=kCmlz1YBhFmcdCOk1/VPIKYx4XogSZc/R7HrpcNjh2CjQIKVmh69Fk5qLWw8awqOSLYwOK1vPM9etR/mX63by6q16KNhhjU0CSSmUjLnfvveYLrrwQgfhb24LrXY7BqWMR8C4TmCe6QOFJjxxCCTIecyIVTi7PvpA+uOAHHF8ni87akIanbBn/0/UELCELc/7SZhNsjo4JZFBFyqiNJpJE/FZoIR0apFnN7kARoyZxfdJ1rUmbrWSX1HaemBV4ttHNvXxqgVNEQ1X6nPeBUTmpSYsZDFBdCdJd2lcKkvmrplCjf3/OJV4ep/qlAxWgAMo6NqFDHYPf90TJ8r5CZfRA== 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 DBAPR04MB7431.eurprd04.prod.outlook.com (2603:10a6:10:1a1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.15; Wed, 4 Dec 2024 12:29:05 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%4]) with mapi id 15.20.8230.008; Wed, 4 Dec 2024 12:29:04 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH 2/3] Bluetooth: iso: Always release hdev at the end of iso_listen_bis Date: Wed, 4 Dec 2024 14:28:48 +0200 Message-ID: <20241204122849.9000-3-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241204122849.9000-1-iulia.tanasescu@nxp.com> References: <20241204122849.9000-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AS4P189CA0023.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5db::11) 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_|DBAPR04MB7431:EE_ X-MS-Office365-Filtering-Correlation-Id: dd9be283-1e0d-46cc-107f-08dd145f3dca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: 9Gl/xA4Lzrdi2S/czjyeV6bimt7zzO37gmdyPFIiGI1fmr8+1enj5//cxcSBLtVWLst11SLsbUh1dG1QXzrpPcKxyhF0hQjUdinOLAnKj00GtyG6Imjt6HmU6KOhORuH16qHkM3m3AZsawPTinSEW50LZl5Jhqz48hQygZPij+pathPdTrgzVQl/bjCuP2m7H6G9xUeolADHIwWlawKcDipH3XPY600jwmZ3xSsYcJYOi84+9gicffkr721TIn1qX4q7rY/fpfaIIw/wJLV6nxsDW5De+PuvIgREdpF8tHe3pJdX2dKpFvLkfgDZC+fV3/52E7jlLdxUa4700CmnxNoL2QmciD3RhC1ctFdyy4jHlkAKbAwCrq+Ezmi7IyQVUkaG0mXquxK/aZEHE0i8hzAagQE1KcHkrmgWEOLTb4UIYVhb0gm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68N4cYz3rBpzLiS7HnXfAPwuAmAN8xLHLaiaiSmbrzIu7saWpq4Fjxot5l6MlSUo8302CEHIQ5A/CfI9cQr0RvQVGDlR/l/0Svp3zHePVGJgML7Ds0Thk7CH4AVb/MqLSf+7Y6AIbZjjN5j6+505OiBO3mnkzPXDGfllN5kZdvizkFMRu7X5lNpOEHDpbnVp/q8eCr9DdhwHi3+05oDNSO0cepktiSsuiqXYc1WvHg77NQXzdJ31hrPM47/vbx4SgC9NqfYgagk8GPxtuf7PAlpSTaBSxCUsicA1NRaC+M+1z7YsCt5jWehgwFnWU4mcHj2Ko/ogSAP0in2VH2XZnuSfKjCV+6T2UZh65r6KcLihf3/8ZDPPy8sjRlX45hM0QS+5X94sBoaU46Cy8wb1WmIs/wYi9w5Q49Zjl1eXDzW80fUthvnAdp1bHmiII1FGnWJANhLuvy/8P7My/o3rR19Mwoz7A2izVZzpLxLI5X7PC5029WU2O10KcNFFoPyLzcT/Hhk7QMpwTZrnfVlnctpNHHvemshU89ZNG2+upkm2M6VCMS5ldJlBiDstorWn6TPag2yX4JdzEwY8eBDATVsnwWi0M6aASut0GSTtw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd9be283-1e0d-46cc-107f-08dd145f3dca X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2024 12:29:04.9065 (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: WHc88r3nC8sowufGfVOmVp7jq550cSrKTbKLLNj8C+eSDNJL8LV/e8ptS1AuStb4J0BwE9vo17f3Ee1J7nXIUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7431 Since hci_get_route holds the device before returning, the hdev should be released with hci_dev_put at the end of iso_listen_bis even if the function returns with an error. Signed-off-by: Iulia Tanasescu --- net/bluetooth/iso.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c index cb004b678d65..df523a09ca9a 100644 --- a/net/bluetooth/iso.c +++ b/net/bluetooth/iso.c @@ -1167,14 +1167,14 @@ static int iso_listen_bis(struct sock *sk) goto unlock; } - hci_dev_put(hdev); - unlock: /* Unlock order should be in reverse from lock order. */ release_sock(sk); hci_dev_unlock(hdev); lock_sock(sk); + hci_dev_put(hdev); + sock_put(sk); return err;