From patchwork Fri Nov 3 15:58:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1858971 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SMQRB4HJWz1yQq for ; Sat, 4 Nov 2023 02:59:18 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id BA5C5400DC; Fri, 3 Nov 2023 15:59:15 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org BA5C5400DC X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id blG49xmopeD1; Fri, 3 Nov 2023 15:59:11 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id C8A9A400A4; Fri, 3 Nov 2023 15:59:10 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org C8A9A400A4 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A6289C0039; Fri, 3 Nov 2023 15:59:10 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 07CE6C0032 for ; Fri, 3 Nov 2023 15:59:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id CA4A3402A6 for ; Fri, 3 Nov 2023 15:59:08 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org CA4A3402A6 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aqpq7vXvWPYZ for ; Fri, 3 Nov 2023 15:59:07 +0000 (UTC) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by smtp4.osuosl.org (Postfix) with ESMTPS id 5BD69402A1 for ; Fri, 3 Nov 2023 15:59:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 5BD69402A1 Received: by mail.gandi.net (Postfix) with ESMTPSA id 88C8B1C0002; Fri, 3 Nov 2023 15:59:03 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Fri, 3 Nov 2023 11:58:53 -0400 Message-ID: <20231103155853.4137224-1-numans@ovn.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-GND-Sasl: numans@ovn.org Subject: [ovs-dev] [PATCH ovn] ovn-ic: Destroy the created index row for ts. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Numan Siddique Otherwise there would be a memory leak if icnbrec_transit_switch_index_find() returns NULL. Fixes: cf1b9920c48e("ovn-ic: fix potential segmentation violation when ts is deleted") Signed-off-by: Numan Siddique Acked-by: Mark Michelson --- ic/ovn-ic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ic/ovn-ic.c b/ic/ovn-ic.c index eec466ec4f..9c7b236cb4 100644 --- a/ic/ovn-ic.c +++ b/ic/ovn-ic.c @@ -1638,11 +1638,11 @@ collect_lr_routes(struct ic_context *ctx, icnbrec_transit_switch_index_set_name(key, isb_pb->transit_switch); t_sw = icnbrec_transit_switch_index_find( ctx->icnbrec_transit_switch_by_name, key); + icnbrec_transit_switch_index_destroy_row(key); if (!t_sw) { continue; } ts_name = t_sw->name; - icnbrec_transit_switch_index_destroy_row(key); routes_ad = shash_find_data(routes_ad_by_ts, ts_name); if (!routes_ad) { routes_ad = xzalloc(sizeof *routes_ad);