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 C6848A0C47 for ; Tue, 15 Jun 2021 14:22:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B9F5C40140; Tue, 15 Jun 2021 14:22:26 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id D5F1440140 for ; Tue, 15 Jun 2021 14:22:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623759744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ohwWoDdpzdkszQv72FaX5TWJR4xyDd4DhCQKmLEDT3c=; b=hXdFls0AmN05w5aZoHIxAfJfwrgTX8gMyYEkDnKkOeRRMDsHNO6HccDPS3HiYf6GQgeOca qYx3wXgT4AUOduoKTmALfH79JlsWBJbB1j1gCNdLvhxc4siAJ+l9MJwo1fA6dL58DCT8UD 4J999SVh4mokS9E4EC1GXXegOPccBwg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-555-McMaGQXIOlaVJlvDSFFgVA-1; Tue, 15 Jun 2021 08:22:20 -0400 X-MC-Unique: McMaGQXIOlaVJlvDSFFgVA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 30B94107ACF6; Tue, 15 Jun 2021 12:22:19 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A8215C1C2; Tue, 15 Jun 2021 12:22:17 +0000 (UTC) From: David Marchand To: stable@dpdk.org Cc: xuemingl@nvidia.com, Shepard Siegel , Ed Czeck , John Miller Date: Tue, 15 Jun 2021 14:22:11 +0200 Message-Id: <20210615122211.25457-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-stable] [PATCH 20.11] net/ark: fix leak on thread termination 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" [ upstream commit b8b5dc6b9596a07cbeed03192b41a4befb75acc6 ] A terminated pthread should be joined or detached so that its associated resources are released. The "ark-delay-pg" thread is just used to delay some task but it is never joined by the thread that created it. The easiest solution is to detach the new thread. Fixes: 727b3fe292bc ("net/ark: integrate PMD") Signed-off-by: David Marchand --- drivers/net/ark/ark_ethdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 0156eeb66e..c307880ec1 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -2,6 +2,7 @@ * Copyright (c) 2015-2018 Atomic Rules LLC */ +#include #include #include #include @@ -585,6 +586,7 @@ delay_pg_start(void *arg) * perform a blind sleep here to ensure that the external test * application has time to setup the test before we generate packets */ + pthread_detach(pthread_self()); usleep(100000); ark_pktgen_run(ark->pg); return NULL; -- 2.23.0