From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC189606A322 for ; Thu, 3 Dec 2026 18:01:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=WkeUelLI Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 565D340671; Thu, 3 Dec 2026 19:00:56 +0100 (CET) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTPS id 2389C4064F for ; Thu, 3 Dec 2026 19:00:55 +0100 (CET) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2f03f3631b2so1090605ad.2 for ; Thu, 03 Dec 2026 10:00:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796320853; x=1796925653; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6f6oFVYGuEodqWsWEzNLAm8sQaEWZiTsgxOGM0Jh3h8=; b=WkeUelLIvTwbXe/TRn9dj5aQMOvVmS1yNqxnMUfkYHkS0jGJY23INesrdqzdAU86jq boGOlKC0NxRPm3uVJIClyRrvAJgcJ9Z4KPaf8J84N43Xttxrw3fDTyi0e0q2aObJyiSP 3mUSgbmtU/aVjnVFo+VSS0B4CI9+3fO9auKWBGBbEsNTMfzxHD2yDVxVLzarD1FTuEfI jGAxgb0HuVarIABQNpc5GV9NdC2NTO+sPIw4f9Kw89f2com2zVjPGr3wsbZFStT6OmKH 5qwuimfeI/jWp5rQ4AGpu+SC73ayj6TLWp9JeHm1a6oNtiyvXbH22CzVOSuanILKdTRP 7++Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796320853; x=1796925653; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=6f6oFVYGuEodqWsWEzNLAm8sQaEWZiTsgxOGM0Jh3h8=; b=QmMF26+xMl3U7CNaMa5YBUUaCH7ofl6s5NxHuKDv3UsKvgund2a6ivmxNflH6tKFFb 7NemGZXb/h0btCD/KrV2rpdgqOYH9/99K4VrXifGHa35dZVHxLjrh6cc38Q+h8sx1SA5 VA/PmtrWtiC/24+Dh7CfN5ORSMK8LhSIMSUmHxID8GKXPUJ0chLXIz0XTAQg0q9sGusn yW9X5dPptZUtU4dHwfhjtLgk3heUE0yhDQqo3OX1u3AQUh2JdEJiWqfkHFuT3Kd0ro7K WVrhnfQuWHxtvfFkEKTbRvcXnVuvXh2MxgOvjepJgrRVT7iYgN6pFMiQoAN2BbYWIhH9 3sRQ== X-Gm-Message-State: APuU4Z/ddVDyzqx9sI0xpWdc4jJuRVa2HAZlWOUNSG/EzD7KlT+ySDVA UaBLWjdrlkHU9OXV6ySKpyaoJ2SaPYUvL+T73qcBQsxywSDv7WI90ODf47uu9LtvMP9fOLp3Ng4 dXTWv X-Gm-Gg: AZFdTZcRuxhbMn8I0ioH6NMN43Yv5BGpI5CoY9U/TOcQPH6rbQRPyQXSbF0nL0aB9sr 3UIusp4gNkABkvcDwcRw9h3nDP9BDLcsnVqnQlWdRClpB7WiWxcvTFhaGPfJ/LbP1U27rLs8ThI x88Yw50r5Ob6NxZuSjMhIHrXwaUMmMdo6aX3aM6UvuY/vKuQJcclXd7DP1aY+uoEfk7ZZ2GvzLq 72eM/l5JcvI2V3eUY3bnCKTqnu04yj7w3oCh7G0LqXi60hgXAogZ3HaZCTFiXOOmWyKzsXsWrzw qe4ymdh2Z1Ae1TOzpnkIx9IVe7Z7tA00Qs93FqvTG040lylzTbTAASVO0w10Us1hAVQILUvlhEd +BEmHtcCd9oUQq5NZvpWIee18IO4MaTEWyMsUB0cp3qvPsuB6ut9KqMYTYZISC3DUTzHz8nRd/r wnY9mMpMBq0XZjvontzHD3/yprLIC7b0cTex4kygHE/VYOtiOCiIrJ//Iq8IiDeuUU3K7gAkzGp /HDhRF6D0wys9Nm9rOnU1q9PvH3SiB445ym2yWxEv/MAnXUTnaJv8cQeMr8hebzv75zvvbsXSNq COsB+54F7ptevBHXwL/3w3D2JfTEday9K4WHBxOhPa4mkBXoIsqe1eCMxKHjX1qK6Nel X-Received: by 2002:a17:90b:1cc4:b0:3ac:ffb8:1809 with SMTP id 98e67ed59e1d1-3b41caea9e3mr39034991a91.39.1796320853265; Thu, 03 Dec 2026 10:00:53 -0800 (PST) Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7649efbsm5329952a91.3.2026.12.03.10.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 10:00:52 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Jerin Jacob , Kiran Kumar K , Nithin Dabilpuram , Zhirun Yan , Amit Prakash Shukla Subject: [PATCH v3 1/6] graph: fix double close of pcapng file Date: Thu, 3 Dec 2026 09:59:43 -0800 Message-ID: <20261203180050.73444-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261203180050.73444-1-stephen@networkplumber.org> References: <20261201224258.1962108-1-stephen@networkplumber.org> <20261203180050.73444-1-stephen@networkplumber.org> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 If adding an interface to the capture file failed, the error path called rte_pcapng_close(), which closes the file descriptor, and then closed the same descriptor again. Only close the descriptor directly if rte_pcapng_fdopen() failed. Fixes: df5908c98abc ("graph: fix pcapng file support") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- lib/graph/graph_pcap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c index 78859ec2d4..07678d967d 100644 --- a/lib/graph/graph_pcap.c +++ b/lib/graph/graph_pcap.c @@ -128,11 +128,13 @@ graph_pcap_file_open(const char *filename) done: return 0; error: + /* once rte_pcapng_fdopen() succeeds, the fd is closed by rte_pcapng_close() */ if (pcapng_fd != NULL) { rte_pcapng_close(pcapng_fd); pcapng_fd = NULL; + } else { + close(fd); } - close(fd); return -1; } -- 2.53.0