From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id ECC48A0562 for ; Fri, 2 Apr 2021 06:35:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D65DE1410AF; Fri, 2 Apr 2021 06:35:05 +0200 (CEST) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30056.outbound.protection.outlook.com [40.107.3.56]) by mails.dpdk.org (Postfix) with ESMTP id 017AA40150; Fri, 2 Apr 2021 06:35:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WDGgogEpQkSuyUheivCprL5jETeFe9uTXWwjS+ZZ018=; b=CJTAO3ByPFn5ts8ZoCBTRrgzrIt99msqkZZ4yot4P5SLx+OL1sa63SG7Y/h1y0MpVu1ohG/lEcfQ1jmdBdgVpfHGE6lztpaazgYVx63C+yeU42RAWvyKKFc7Xiak/6ucNgQbxjGCDI+FJ/AUZhiLCuyiAnk0kI0VePQ3Bw1remU= Received: from DB8PR04CA0021.eurprd04.prod.outlook.com (2603:10a6:10:110::31) by AM6PR08MB5109.eurprd08.prod.outlook.com (2603:10a6:20b:ec::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.27; Fri, 2 Apr 2021 04:35:01 +0000 Received: from DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:110:cafe::d9) by DB8PR04CA0021.outlook.office365.com (2603:10a6:10:110::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.27 via Frontend Transport; Fri, 2 Apr 2021 04:35:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT061.mail.protection.outlook.com (10.152.21.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Fri, 2 Apr 2021 04:35:01 +0000 Received: ("Tessian outbound 82c2d58b350b:v90"); Fri, 02 Apr 2021 04:35:01 +0000 X-CR-MTA-TID: 64aa7808 Received: from f60f7f610def.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 078654A0-8CAE-4AB9-A3E6-0B0C4CF15CEA.1; Fri, 02 Apr 2021 04:34:55 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f60f7f610def.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 02 Apr 2021 04:34:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ACz6I2M+s7F9HY2olF6XFTxvPKDxJk4x60DKXEZVc/rg1vu8o6IcBLk28kH54Ymmt862nJF5wzd+9zDZUCfLnJEV6HzUIw4bFdcbgwLtZ+vlj8CWAypCHXI6BSPdF2q/UXlTzwyjXifNsvI2NH/2OJH01Fd31xxjNOxe3vIRU84RoY7h4MV84JD9wE2boX5QlE8yOPe0qcIso3TBgw6EunnYPdrROG0ufR2ODPLub9wb/dx+86DWC7rSfTFjCihgL7+DpLkVSgzWBxm5rZGsq3iZjkARH52nbrLCYySCJUze4xYMEc+TswxlKKz1T+nfHxSJo8zBze1RPnKVxEAueg== 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-SenderADCheck; bh=WDGgogEpQkSuyUheivCprL5jETeFe9uTXWwjS+ZZ018=; b=JGQs5untaiN0+DI4d3M+coLGi3qE2QVNzji2WVnEfkoOzezDn00DLu+vU+c0lRaSh8OuvtTSGahzK4XIITtmQ+uHchR/r5oRSRbrLBujggJbSGcp/QMjxxSN+ShD9ZNLSFuHjzSz1S6oq+yyLkwW0RXjfEFBdY5DPaFjqvkehePBkP6rNrTiYsz0OtwIK32iFxTwPIkvw0sx9d0AJtJHcwYV3vj/66blrsqJwZ/B2C6JDSSdUhQlCiYluJeeEA5iQogotc97CHFPuAcs3tIKxNB8Lina1p62Vtc8lc42PHEqZYhJ80/5xHTFoDCeN6p9HEkvWzveRiGYyOHRG2P/1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WDGgogEpQkSuyUheivCprL5jETeFe9uTXWwjS+ZZ018=; b=CJTAO3ByPFn5ts8ZoCBTRrgzrIt99msqkZZ4yot4P5SLx+OL1sa63SG7Y/h1y0MpVu1ohG/lEcfQ1jmdBdgVpfHGE6lztpaazgYVx63C+yeU42RAWvyKKFc7Xiak/6ucNgQbxjGCDI+FJ/AUZhiLCuyiAnk0kI0VePQ3Bw1remU= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB6PR0802MB2152.eurprd08.prod.outlook.com (2603:10a6:4:83::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Fri, 2 Apr 2021 04:34:52 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::2994:a01e:2de:f94e]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::2994:a01e:2de:f94e%7]) with mapi id 15.20.3999.029; Fri, 2 Apr 2021 04:34:52 +0000 From: Honnappa Nagarahalli To: Olivier Matz , "lucp.at.work@gmail.com" CC: "dev@dpdk.org" , "jianfeng.tan@intel.com" , "david.marchand@redhat.com" , "stable@dpdk.org" , nd , Honnappa Nagarahalli , nd Thread-Topic: [dpdk-dev] [PATCH v2] eal: fix race in ctrl thread creation Thread-Index: AQHXIWnutfwPWpMgcE2nfFKuMxTz6KqgijKA Date: Fri, 2 Apr 2021 04:34:52 +0000 Message-ID: References: <20210324130422.92357-1-lucp.at.work@gmail.com> <20210325112731.16324-1-olivier.matz@6wind.com> In-Reply-To: <20210325112731.16324-1-olivier.matz@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 222D907FDF39BF44B7B307B0E96AD35E.0 x-checkrecipientchecked: true Authentication-Results-Original: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [70.113.13.105] x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: d321af3e-4b08-47ec-0376-08d8f590adaf x-ms-traffictypediagnostic: DB6PR0802MB2152:|AM6PR08MB5109: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:10000;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: cslEcQdQe1BwrUWomLn8xI9sEijMyWingzoaBQgT+25t5FRFlqO84fadncROjRP+9BUq8sa8NLPZDVC572ixru4gNvai7vcCTdw2fB31PCmrujT9EWmDFpr1OmrYINpmfQqcGhWaKUdw2c75g1u2FtTxq3oTVVyg9EriZsOEeGvJflAYahCM7N8e+wYEEFCwpCGoSjjna4YM/+EehHjNMyDdcrvaPHdjmKroGm7XlLNL655aTLADgIBawHkzhRsGJ7IwMVgGgzM+Devztf0JR22ZXAMc6W/4G/fnYuBpDXGJD5MrC5MY7SLGQuWOnZ3oxjiwVse+44M8u/FhA0E435jIkmiTqRgvudkN2+VmBlqTSKrPRp9XblyS77qDDoq+lLkGeLvr0l6Yd01ysqmxqvkYQzzqms8vqgwbo1bypaSDWNHexSuZycs4vqT7pBXthUMFgkcYT9yjHtGgIFIuai9n2IBPp56T2EU+CNwFnRVJsEpM8gB9gYTkeCzBQqk0I3XmazQ/Ish5PdZkGs+HLmAz7cEfHVDTAywpwpxDusUwhqjibJnRJDFaWCBz855FAsVKmcyH5s0P6ke/SyvcpKuOigK/Ehs1Q9Yl5kowETIp+RH3bs/83LG+hbMLmvH9DJZ1w1lQRa2/8Iuffrkasg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(39860400002)(376002)(136003)(346002)(76116006)(66476007)(66556008)(66946007)(7696005)(64756008)(316002)(66446008)(110136005)(478600001)(33656002)(5660300002)(26005)(86362001)(71200400001)(54906003)(186003)(55016002)(9686003)(4326008)(83380400001)(8676002)(8936002)(38100700001)(2906002)(52536014)(6506007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?shAgq+zKlIccxEcsKnCohMWT0/AwhGixo8pvrip+AWXviyS80JbbWtniHlAe?= =?us-ascii?Q?5qVn8CXSfmZUdnYGIFKl0tHSVUfJdgNb87LMj0/bwdkLF5UAh8YrlQweBAWW?= =?us-ascii?Q?IaOpRx2yJHOMGowrq5hI/Cxw/jm576goRDhbPXYDEVQLm3Q4s6If4qPSzSuP?= =?us-ascii?Q?479FOp4+zVhrbb1syY+o87Uc7qNiCQI04nseSpS/xvsBhIkEu837ktpBAw27?= =?us-ascii?Q?ZIa+/glGDj8Yg1lUSlp7ukAsb9fPJvxpq8Wp6oZne6kyHMf5lxb+w6lUAndC?= =?us-ascii?Q?NOxU8YeuY7EbrzugB2Rrhb3I53R2quuj0fkpqOpgDxyV3hiYjOXV/4EAV1k0?= =?us-ascii?Q?YaXFYN2cTnbRTD1IeMRVdkO1djyFpbzl79hhXMStOfA6QOJM/SerpNINrJUB?= =?us-ascii?Q?g+kqw8ERpNVu1U/cBPoU94pMMN2TvG5AZKgYnODeYgqk5AswFbaJjA51KyA5?= =?us-ascii?Q?FzboSxdYCRHENEepbf2eiJwBkg4ckp+bov0T02O9srLJjC8pNSuEaePfDDpf?= =?us-ascii?Q?/D5n8JSeSH7ueN5/+sEdjdey0FeOqilTJXEagtceyXwIZbkOOaJmPGIoP16t?= =?us-ascii?Q?YcuDprGGm2geyL8O0RDg/ArgAJnVaWgcataKmxFkxfXveuUG50iAQTaVYzFq?= =?us-ascii?Q?T0YIJXTovLZC+oDv/UTJSKSD5MixXRxvc/ZKtVegtCROgvhXgs/9G1leFhT4?= =?us-ascii?Q?KxK1UMlHUeY7GivGnpAor9oVI+28EOT62wl58bd0P6LKnsQSjgyq1nyn+uwA?= =?us-ascii?Q?sTYKdMGBp87l2S0QMtN1naxeSuDIPEiReyVJMBdEb7oY2IFzAx95VFaKz2Nt?= =?us-ascii?Q?P6qeuY1n14jTWjJjs7nCMd3tntGQlljGcjnwGT5ae+TOhckgxtNvnSi0oqOG?= =?us-ascii?Q?lD7rAf1e+MXtb3p5/MksyJLlxJhwu2NmIbcfGjkVD3ndJEW+zErd1IjlssjM?= =?us-ascii?Q?06PDsdU/JvEwATW72Km7TDKpslJkivWF77yJg8TcdIXhtP445vmpgW04mkyZ?= =?us-ascii?Q?VB0abNFgmvFbRrDen9JcHcP3rQgCKYNHlkxgWB+lFuQMT/AHqsfOfkvq5I2N?= =?us-ascii?Q?+X9nyTeFAVXIH6VKTjEygmHfRuKu+lnBp7AhJ9tx+4/jXvwHIWE6lX8Xeejm?= =?us-ascii?Q?X5kjOpg8jHa4NzeysVuMYGpVwQLU3OszvrV03MeznH6UUkBmENUS+CzWTM21?= =?us-ascii?Q?f5gxLPgd76YC9RWVqda6WkFWlW23OVh8MZzujoyyU3x1Z4oYISlS3saz9UkA?= =?us-ascii?Q?1DJqtnZ1WiDVLWPsh/rOGEdRz/uYYFGv4VWgjU5pjmMGn5vRevru2lYlSQ9/?= =?us-ascii?Q?rxZovCCAuoFyeEmvMDJjuITm?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2152 Original-Authentication-Results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 440d81fd-50ca-4e04-2a4f-08d8f590a8c4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GPpTS/lTfQk+2uPDh11N1PQ+Fl09pbchwWzVNd//DmNpVW7M1KOXnSI4xfOYmPWr51MzUcsjNuJOYdSNRO6K5z+IEYMZtqjSnoNOarEgr6KIl2hfbg8eJz3o8lA1T5vGXCPtQPg/+ncqJKdlO1lp9QntrFZPDA/LSEBcC0zJvhbnbaDU2Pd9jz+8devVHfAhsFJKrYPE42FIi46WRxt6X96GSwiYMjakAVQsVVzDe5dPLKil9LaZ+4aE2Q+sJQL49/9rqq2+jxSbOgP6yoD31DNCHuwGTf0DNMfsiyI83OC+4VVHjMYF8ZnBgjJ3vlHdkO5qFGl2m4a0j2EAZeuScFiEnATF4iKxpcb+g5v9MxImplK9JQfcXgV5htLDbPxciqgAQE+RVaT99l0u4XlaeatxgPSfo6nx2dUjbEDjn2p0NOcoFcDZ0AiwigULxatAkFLPtp6ayMDy0eUxeRfIzeQgIufjo/33agMlM68DJbE6wQHJBvZ6Xj4S6A04sEp1Eh60h7du5b9abuu/5P1hFue7lfFQ78fSrJAL7xzL2loom/zVumrOWZsTH9HcfWE/1HW2O2bhxprgsk1CYK7uWhiJ+ZMCQoalhAUw4op8cPUaUved1Sdxb1RvxmzOX9z3296Y27OjxPs0VTU0zaNHbQ== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(46966006)(36840700001)(47076005)(186003)(110136005)(86362001)(36860700001)(8676002)(33656002)(5660300002)(478600001)(7696005)(450100002)(52536014)(83380400001)(82310400003)(82740400003)(336012)(26005)(2906002)(81166007)(55016002)(356005)(316002)(4326008)(70586007)(6506007)(70206006)(54906003)(8936002)(9686003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2021 04:35:01.0849 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d321af3e-4b08-47ec-0376-08d8f590adaf X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5109 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] eal: fix race in ctrl thread creation X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" >=20 > As reported by Luc, there is a race where the barrier is destroyed by one > thread, while the other thread did not yet leave pthread_barrier_wait. Please correct me if I am wrong. We are using the pthread_barrier to 1) know when to free 'params'. 2) set the thread affinity before the thread starts running its function I think this patch is fine. But, it can be simplified. >=20 > This patch fixes the race condition by adding an atomic counter to ensure > that the barrier is destroyed only it is not used by any thread. >=20 > Fixes: 3a0d465d4c53 ("eal: fix use-after-free on control thread creation"= ) > Cc: jianfeng.tan@intel.com > Cc: stable@dpdk.org >=20 > Reported-by: Luc Pelletier > Signed-off-by: David Marchand > Signed-off-by: Olivier Matz > --- >=20 > Hi Luc, >=20 > Thank you for reporting this problem and submitting the patch. > I think the issue can be fixed without any loop, like in this patch. What= do > you think? >=20 > Regards, > Olivier >=20 >=20 > lib/librte_eal/common/eal_common_thread.c | 38 +++++++++++++---------- > 1 file changed, 21 insertions(+), 17 deletions(-) >=20 > diff --git a/lib/librte_eal/common/eal_common_thread.c > b/lib/librte_eal/common/eal_common_thread.c > index 73a055902a..891f825e87 100644 > --- a/lib/librte_eal/common/eal_common_thread.c > +++ b/lib/librte_eal/common/eal_common_thread.c > @@ -170,11 +170,11 @@ struct rte_thread_ctrl_params { > void *(*start_routine)(void *); > void *arg; > pthread_barrier_t configured; We can get rid of the barrier variable. The 'barrier_refcnt' is enough to k= now when to free the memory. Setting the thread affinity can be moved to 'ctrl_thread_init' function. > + unsigned int barrier_refcnt; > }; >=20 > static void *ctrl_thread_init(void *arg) { > - int ret; > struct internal_config *internal_conf =3D > eal_get_internal_configuration(); > rte_cpuset_t *cpuset =3D &internal_conf->ctrl_cpuset; @@ -184,8 > +184,9 @@ static void *ctrl_thread_init(void *arg) >=20 > __rte_thread_init(rte_lcore_id(), cpuset); >=20 > - ret =3D pthread_barrier_wait(¶ms->configured); > - if (ret =3D=3D PTHREAD_BARRIER_SERIAL_THREAD) { > + pthread_barrier_wait(¶ms->configured); > + if (__atomic_sub_fetch(¶ms->barrier_refcnt, 1, > + __ATOMIC_ACQ_REL) =3D=3D 0) { > pthread_barrier_destroy(¶ms->configured); > free(params); > } > @@ -210,15 +211,17 @@ rte_ctrl_thread_create(pthread_t *thread, const > char *name, >=20 > params->start_routine =3D start_routine; > params->arg =3D arg; > - > - pthread_barrier_init(¶ms->configured, NULL, 2); > - > - ret =3D pthread_create(thread, attr, ctrl_thread_init, (void *)params); > + __atomic_store_n(¶ms->barrier_refcnt, 2, > __ATOMIC_RELEASE); We can use __ATOMIC_RELAXED or just a simple assignment as pthread_create e= nsures that all the earlier memory writes are visible to the 'ctrl_thread_i= nit'. > + ret =3D pthread_barrier_init(¶ms->configured, NULL, 2); > if (ret !=3D 0) { > free(params); > return -ret; > } >=20 > + ret =3D pthread_create(thread, attr, ctrl_thread_init, (void *)params); > + if (ret !=3D 0) > + goto fail; > + > if (name !=3D NULL) { > ret =3D rte_thread_setname(*thread, name); > if (ret < 0) > @@ -227,25 +230,26 @@ rte_ctrl_thread_create(pthread_t *thread, const > char *name, > } >=20 > ret =3D pthread_setaffinity_np(*thread, sizeof(*cpuset), cpuset); I think this can be moved to 'ctrl_thread_init'. > - if (ret) > - goto fail; > + if (ret !=3D 0) > + goto fail_cancel; >=20 > - ret =3D pthread_barrier_wait(¶ms->configured); > - if (ret =3D=3D PTHREAD_BARRIER_SERIAL_THREAD) { > + pthread_barrier_wait(¶ms->configured); > + if (__atomic_sub_fetch(¶ms->barrier_refcnt, 1, > + __ATOMIC_ACQ_REL) =3D=3D 0) { > pthread_barrier_destroy(¶ms->configured); > free(params); > } >=20 > return 0; >=20 > -fail: > - if (PTHREAD_BARRIER_SERIAL_THREAD =3D=3D > - pthread_barrier_wait(¶ms->configured)) { > - pthread_barrier_destroy(¶ms->configured); > - free(params); > - } > +fail_cancel: > pthread_cancel(*thread); > pthread_join(*thread, NULL); > + > +fail: > + pthread_barrier_destroy(¶ms->configured); > + free(params); > + > return -ret; > } >=20 > -- > 2.29.2