From patchwork Fri Apr 29 13:36:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 66947 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp793416qge; Fri, 29 Apr 2016 06:36:11 -0700 (PDT) X-Received: by 10.50.23.71 with SMTP id k7mr4709581igf.26.1461936971397; Fri, 29 Apr 2016 06:36:11 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id aq7si5045550igc.93.2016.04.29.06.36.10; Fri, 29 Apr 2016 06:36:11 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 8B49F615E6; Fri, 29 Apr 2016 13:36:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C1FDC615DD; Fri, 29 Apr 2016 13:36:06 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id B96A9615DF; Fri, 29 Apr 2016 13:36:04 +0000 (UTC) Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) by lists.linaro.org (Postfix) with ESMTPS id E5D76615DB for ; Fri, 29 Apr 2016 13:36:03 +0000 (UTC) Received: by mail-oi0-f53.google.com with SMTP id k142so118454345oib.1 for ; Fri, 29 Apr 2016 06:36:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DuUMJ7XlpMCzI7i7s+Lvz8b7TaIePbCwYFh6V/Rzz78=; b=DIIvFjPIUwJEtTLBKb/I8yLnTnoqgA/UcmqMbr4Q5Ot7t7g+Q3fm5XCf/utzyYAEN6 W7HNIiOIQBtwOxmxdZATn4OVkzTdqzgJTtMfZYi1f1S1pKozocmaiAiU+4OzDyUOdlKC KuS0aA59jBgPWwXIqRaU/YGJQq+0QCgbd/A7fnfq6i4AhmkPHtmfRIJE+nq11F2gci/p KUbNlPYj/vPmQg1GbaD9k3hwJpTXQkXAuCREvWWcnQqsx/PzDyYebPf2Gbn4qVeOq7r+ 7VeqZsnDdG328LWH+eqvxL/2a9FMTC7FiRGUCnKPBMbA19X3CiPr91WNEl6bf07g3FUu T2hg== X-Gm-Message-State: AOPr4FWe2Eg4LyI4zWWtkX6y0oSSOfmcxG2W17Lph8/a/KT35oNL4gAeVDPOhOHgZgH1KSDVbu4= X-Received: by 10.202.91.8 with SMTP id p8mr8157468oib.99.1461936963305; Fri, 29 Apr 2016 06:36:03 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id f36sm4573945otb.20.2016.04.29.06.36.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Apr 2016 06:36:02 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Fri, 29 Apr 2016 08:36:00 -0500 Message-Id: <1461936960-8736-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH] linux-generic: tm: clean up name table during global term processing X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Free all entries in name table during odp_term_global() to avoid memory leaks. Signed-off-by: Bill Fischofer --- platform/linux-generic/odp_name_table.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/linux-generic/odp_name_table.c b/platform/linux-generic/odp_name_table.c index 1e43a2c..801c456 100644 --- a/platform/linux-generic/odp_name_table.c +++ b/platform/linux-generic/odp_name_table.c @@ -1202,5 +1202,11 @@ int _odp_int_name_tbl_init_global(void) int _odp_int_name_tbl_term_global(void) { + int i; + + for (i = 0; i < name_tbls.num_name_tbls; i++) + aligned_free(name_tbls.tbls[i]); + + name_tbls_initialized = 0; return 0; }