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 0A313A0524 for ; Thu, 6 May 2021 11:45:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 009F3410FC; Thu, 6 May 2021 11:45:22 +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 7DD05410F5 for ; Thu, 6 May 2021 11:45:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620294318; 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: in-reply-to:in-reply-to:references:references; bh=9d1v5jY+OAab8uvYoT5RTBR28NWuxq2kq6P6VuiP5/A=; b=IkPovPS/RcH/7wGg0daPSrMQMI6LB+TgDtCCgM2Tx1M4xsaZPRwUKi4dij5c69Fxc2R7ro mNq/jq8Zi+Ikz0wddk4jPF7JJN9NlPqVNdRIvR+wslu78pp+UDWUonBdY6uUwTme8gwATr WQ494ri7CEJv++P+aeBOQYYtyJ8vFT8= 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-441-vnFpq_iPPXmEY9f8vUUVEA-1; Thu, 06 May 2021 05:45:17 -0400 X-MC-Unique: vnFpq_iPPXmEY9f8vUUVEA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9E08D107ACE4; Thu, 6 May 2021 09:45:15 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id D33A65B4B5; Thu, 6 May 2021 09:45:12 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stable@dpdk.org, Shepard Siegel , Ed Czeck , John Miller Date: Thu, 6 May 2021 11:44:51 +0200 Message-Id: <20210506094452.1689-2-david.marchand@redhat.com> In-Reply-To: <20210506094452.1689-1-david.marchand@redhat.com> References: <20210506094452.1689-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 1/2] 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" 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") Cc: stable@dpdk.org Signed-off-by: David Marchand --- drivers/net/ark/ark_pktgen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ark/ark_pktgen.c b/drivers/net/ark/ark_pktgen.c index 28a44f7546..515bfe461c 100644 --- a/drivers/net/ark/ark_pktgen.c +++ b/drivers/net/ark/ark_pktgen.c @@ -3,6 +3,7 @@ */ #include +#include #include #include @@ -474,6 +475,7 @@ ark_pktgen_delay_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(inst); return NULL; -- 2.23.0