From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 2F4DB4C99 for ; Fri, 27 Jul 2018 12:18:13 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id t25-v6so4893375wmi.3 for ; Fri, 27 Jul 2018 03:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YIst79p6SbTVVzkFqMnBQW7LCXlzeoXAW8ijmGLB6MQ=; b=WCzv9oXwgKKUao8g+aVNZQj4HHV2VhvtUw9crApLXovYvK08fg1Vh9YFrh9vo5mvgj PTEcBHCBGA4QMBteDxdUpmiD18LcluHnrrM63YRBqlMTZnNgTwZjcV+r1gEZNY1WxVQk mJ8AolSs1HQF+AwThLxOk1FMt2KqjxRIotsYTSw1lelySpCed4oVGwEnzTqy0j818/6u neLXp60vleZa8niCfPpxkeBWnkT5agrnN15BHdoyvEiCkGHvQBDQwFcjiwMyQgCV2wXD 0gwdvpO/Rqjt2DrtFPrJhrUmLiNXGWC423bZCiaymWvHGfS6X8vi0lbgTfLnJxHOy5Va yjuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YIst79p6SbTVVzkFqMnBQW7LCXlzeoXAW8ijmGLB6MQ=; b=TxTD1+cwXWFjuQNLnigxY+F8B9CfRcRgzUMINucCb81tCQhOvlpaSE51yX/okZoIJ+ RVdDGURObXDIzD7wyhZdVHszcX4uPnnvvPMovlhcsZ/cdWs5Hmf5biDP2YmkBqPN9UMN yE/XqoGSIJmMPJh8W2xc9t/JEHZXLy3h12aURwnzcBvxu7PIbq63HHJczg1KxQW52TcW oIhcwd75bb88CogjLboxQtYojbcSvaf6e46SIkSyWf295lg1jXrLtEaG3sJKXUWumcAm xYB6GMi0Py7+yyCMF8WKymMGLkxLxOxN6j4gtj0vaHO3vfEfSDZMgumIJ15rGKe3niJx 7aUQ== X-Gm-Message-State: AOUpUlFH1v+NvkIQlAfPSK2cKyhQCiYaBW14MpqtX1qyLDupIJPTx5F6 MItqMFD+f9xXIWq3A3yipmo= X-Google-Smtp-Source: AAOMgpf67WAkVsLw9jZk1ZDIqynH9sT60bHBF3ZwImKLhlghOJuVxKInCwxrm8Sqrc/zsW/FRmn13w== X-Received: by 2002:a1c:e708:: with SMTP id e8-v6mr3993142wmh.134.1532686692926; Fri, 27 Jul 2018 03:18:12 -0700 (PDT) Received: from localhost ([2a00:23c5:be94:4600:7b12:f8a0:fd52:f87d]) by smtp.gmail.com with ESMTPSA id r17-v6sm2579948wrt.44.2018.07.27.03.18.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Jul 2018 03:18:11 -0700 (PDT) From: luca.boccassi@gmail.com To: Pablo de Lara Cc: dpdk stable Date: Fri, 27 Jul 2018 11:17:47 +0100 Message-Id: <20180727101748.30228-11-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180727101748.30228-1-luca.boccassi@gmail.com> References: <20180724160752.20287-34-luca.boccassi@gmail.com> <20180727101748.30228-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'test/hash: fix potential memory leak' has been queued to LTS release 16.11.8 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2018 10:18:13 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/29/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 825668ecf07f719abe8e8c389a175e38d37b4ad1 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Tue, 17 Jul 2018 14:31:51 +0100 Subject: [PATCH] test/hash: fix potential memory leak [ upstream commit a4492ab49ec3b829745c9060a1719354e0a572b7 ] In the multiwriter test, if "found" array allocation failed, the memory of "keys" array, which was successfully allocated could not be freed, since by this time, tbl_multiwriter_test_params.keys was not set to this array, which is the pointer freed when finishing the test or when a failure happens. To solve this, tbl_multiwriter_test_params.keys is set to the "keys" address, just after allocating and filling the array. Fixes: be856325cba3 ("hash: add scalable multi-writer insertion with Intel TSX") Signed-off-by: Pablo de Lara --- app/test/test_hash_multiwriter.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/test/test_hash_multiwriter.c b/app/test/test_hash_multiwriter.c index 951c3e743..0e9ac7162 100644 --- a/app/test/test_hash_multiwriter.c +++ b/app/test/test_hash_multiwriter.c @@ -181,16 +181,17 @@ test_hash_multiwriter(void) goto err1; } + for (i = 0; i < nb_entries; i++) + keys[i] = i; + + tbl_multiwriter_test_params.keys = keys; + found = rte_zmalloc(NULL, sizeof(uint32_t) * nb_entries, 0); if (found == NULL) { printf("RTE_ZMALLOC failed\n"); goto err2; } - for (i = 0; i < nb_entries; i++) - keys[i] = i; - - tbl_multiwriter_test_params.keys = keys; tbl_multiwriter_test_params.found = found; rte_atomic64_init(&gcycles); -- 2.18.0