patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
To: David Marchand <david.marchand@redhat.com>
Cc: "Wang, Yipeng1" <yipeng1.wang@intel.com>,
	"Gobriel, Sameh" <sameh.gobriel@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>,
	Dharmik Thakkar <Dharmik.Thakkar@arm.com>,
	Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>,
	dev <dev@dpdk.org>, nd <nd@arm.com>,
	dpdk stable <stable@dpdk.org>, nd <nd@arm.com>
Subject: Re: [dpdk-stable] [PATCH 2/3] test/hash: free allocated memory
Date: Fri, 28 Jun 2019 04:59:00 +0000	[thread overview]
Message-ID: <VE1PR08MB51491E58B1CFDF3C5D07754298FC0@VE1PR08MB5149.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <CAJFAV8zQ7WvUC_N51bE0gZ4zFbickjBXNx12dSb3e0DTbTiJEg@mail.gmail.com>


On Thu, Jun 27, 2019 at 5:25 AM Honnappa Nagarahalli <honnappa.nagarahalli@arm.com<mailto:honnappa.nagarahalli@arm.com>> wrote:
Free allocated memory.

Fixes: 3f9aab961ed3 ("test/hash: check lock-free extendable bucket")
Cc: stable@dpdk.org<mailto:stable@dpdk.org>

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com<mailto:honnappa.nagarahalli@arm.com>>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com<mailto:dharmik.thakkar@arm.com>>
---
 app/test/test_hash_readwrite_lf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c
index e9aca6ff4..e92d1065b 100644
--- a/app/test/test_hash_readwrite_lf.c
+++ b/app/test/test_hash_readwrite_lf.c
@@ -1431,6 +1431,8 @@ test_hash_readwrite_lf_main(void)
        rte_free(tbl_rwc_test_param.keys_ks);
        rte_free(tbl_rwc_test_param.keys_absent);
        rte_free(tbl_rwc_test_param.keys_shift_path);
+       rte_free(tbl_rwc_test_param.keys_ext_bkt);
+       rte_free(tbl_rwc_test_param.keys_ks_extbkt);
        rte_free(scanned_bkts);
        return 0;
 }
--
2.17.1


I inspected this test a little more, I can see other leaks.
- generate_keys(), on error, we are leaking tbl_rwc_test_param.h.
- test_rwc_reader(), we are leaking pos.
- test_hash_readwrite_lf_main(), we are leaking tbl_rwc_test_param.keys_non_shift_path
[Honnappa] Thanks for the review. I fixed these and few more in V2.

Looking at your patch 1, I would prefer you reset tbl_rwc_test_param field per field to NULL once the rte_free() is called.
It would then be easier for you to track the remaining leaks (and patch 1 disappears).
[Honnappa] This can be considered as initialization code. I have left this as it is.


--
David Marchand

  reply	other threads:[~2019-06-28  4:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27  3:24 [dpdk-stable] [PATCH 1/3] test/hash: reset global variable to discard old data Honnappa Nagarahalli
2019-06-27  3:24 ` [dpdk-stable] [PATCH 2/3] test/hash: free allocated memory Honnappa Nagarahalli
2019-06-27  8:07   ` David Marchand
2019-06-28  4:59     ` Honnappa Nagarahalli [this message]
2019-06-28  8:36       ` David Marchand
2019-06-27  3:24 ` [dpdk-stable] [PATCH 3/3] test/hash: init hash parameters in the correct function Honnappa Nagarahalli
2019-06-27  8:07   ` David Marchand
2019-06-28  4:55     ` Honnappa Nagarahalli
2019-06-28  4:52 ` [dpdk-stable] [PATCH v2 1/3] test/hash: reset global variable to discard old data Honnappa Nagarahalli
2019-06-28  4:52   ` [dpdk-stable] [PATCH v2 2/3] test/hash: init hash parameters in the correct function Honnappa Nagarahalli
2019-06-28  4:52   ` [dpdk-stable] [PATCH v2 3/3] test/hash: free allocated memory Honnappa Nagarahalli
2019-06-28  8:38     ` David Marchand
2019-07-02  0:27 ` [dpdk-stable] [PATCH v3 1/4] test/hash: reset global variable to discard old data Honnappa Nagarahalli
2019-07-02  0:27   ` [dpdk-stable] [PATCH v3 2/4] test/hash: init hash parameters in the correct function Honnappa Nagarahalli
2019-07-02  0:27   ` [dpdk-stable] [PATCH v3 3/4] test/hash: free allocated memory Honnappa Nagarahalli
2019-07-05  8:46   ` [dpdk-stable] [dpdk-dev] [PATCH v3 1/4] test/hash: reset global variable to discard old data Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VE1PR08MB51491E58B1CFDF3C5D07754298FC0@VE1PR08MB5149.eurprd08.prod.outlook.com \
    --to=honnappa.nagarahalli@arm.com \
    --cc=Dharmik.Thakkar@arm.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=nd@arm.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=sameh.gobriel@intel.com \
    --cc=stable@dpdk.org \
    --cc=yipeng1.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).