From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B2BE6A00C5; Thu, 14 May 2020 13:04:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6F41D1D8CB; Thu, 14 May 2020 13:04:04 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 57C301D8CA for ; Thu, 14 May 2020 13:04:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589454242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ypVunzjT88nkkDDByz6zIFQo/2ehe9rHix0fTPIWmFI=; b=dDmwcTRSa5iYb2b4XcbeNb4hfBknEXpwnlbvpPsMmNR6enTMBzG0TU5y2G9vevy9P6NHR2 5fwx1uh1V1rSkzjjumch4EOEIUmgHHNAGHT38Fj6yxbTcEpQ9zfgGNZ/1jUX1DuyScEsXq SIMx2J1RcD6qfJcFvaBKL36WNKAczsg= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-385-Ms6uVbhtN3uE3Na4K8Hvuw-1; Thu, 14 May 2020 07:03:57 -0400 X-MC-Unique: Ms6uVbhtN3uE3Na4K8Hvuw-1 Received: by mail-vk1-f197.google.com with SMTP id e3so1130302vkh.15 for ; Thu, 14 May 2020 04:03:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ypVunzjT88nkkDDByz6zIFQo/2ehe9rHix0fTPIWmFI=; b=cGmQUT0V1RCWAsHAdrW01BA/ZJsRVpPLw5MtqFupYLrc47wg7IFNU/CqR7VOUIuL/w 3nUG2s2/xKKAHzMP5pt9J5br0EiE08WVYLK7qEnr2V7fOHTHDRcEkmcsNsSuyLkW+T/r OuEB7HbQS4Ug+9VZlNvw25OVFcgUHbIB4sf7Te0GwqjWJB06PdUJ+fpZO7CyZnv4cFYZ j+Qz86CLKzwAIWrNqevTmshZbNAe0MjGOC79blsIPm87n0uQA6BKf5g71Zah0Hy8QUiS hSTn2hvTJHXE2QbX0CkTl7LfKLcHxFmHlPPkDxOrMenFdy9pymLHK3AR+NWW3iWwkW+y eSMw== X-Gm-Message-State: AOAM53033zuoPsy9lRDzQXKop1Aq1VLW8ZB/osx9nd4HOpykd8+IigjJ zqvU4zTraan3BVWSHVTgzhyoKig1qRgHzqRiHk/Gzu2KSQGKUlFZuo1MyGHX4cBr95KhX8tW6yw ciXaNvFhUkGabQbt8tko= X-Received: by 2002:ac5:c8a1:: with SMTP id o1mr2912783vkl.56.1589454236935; Thu, 14 May 2020 04:03:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxr8VPp5Wd+5WO8ihn1ZYAcwWHPDhYImMXeg4BAGlmQbC58612rMLYRhvmgDsUOiszPDpBhv4sCq8auAc/ycVg= X-Received: by 2002:ac5:c8a1:: with SMTP id o1mr2912753vkl.56.1589454236652; Thu, 14 May 2020 04:03:56 -0700 (PDT) MIME-Version: 1.0 References: <20200514085658.12287-1-kirankumark@marvell.com> In-Reply-To: <20200514085658.12287-1-kirankumark@marvell.com> From: David Marchand Date: Thu, 14 May 2020 13:03:45 +0200 Message-ID: To: Kiran Kumar Kokkilagadda Cc: Jerin Jacob , Nithin Dabilpuram , dev , "Mcnamara, John" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] test/graph: fix memory leak X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, May 14, 2020 at 10:57 AM wrote: > > From: Kiran Kumar K > > Fix memory leaks reported by coverity. > > Coverity issue: 358439, 358451, 358448. Please no '.' at the end of a tag (and sorting would not hurt). I wanted to get a look at those, but I can't find them in coverity webui. Maybe those issues have been closed, but then I can't look at them.. ? Any help would be appreciated. > Fixes: 6b89650418("test/graph: add functional tests") > > Signed-off-by: Kiran Kumar K > --- > V2 changes: > * Added Coverity issue and Fixes info. > > app/test/test_graph.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/app/test/test_graph.c b/app/test/test_graph.c > index cf6df0744..ed69eda99 100644 > --- a/app/test/test_graph.c > +++ b/app/test/test_graph.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include > > #include "test.h" > > @@ -145,7 +146,7 @@ uint16_t > test_node_worker_source(struct rte_graph *graph, struct rte_node *node, > void **objs, uint16_t nb_objs) > { > - uint32_t obj_node0 = rand() % 100, obj_node1; > + uint32_t obj_node0 = rte_rand() % 100, obj_node1; The commitlog indicates memory leaks, I am a bit surprised to see this change. What is the rationale? > test_main_t *tm = &test_main; > struct rte_mbuf *data; > void **next_stream; > @@ -193,7 +194,7 @@ test_node0_worker(struct rte_graph *graph, struct rte_node *node, void **objs, > test_main_t *tm = &test_main; > > if (*(uint32_t *)node->ctx == test_node0.id) { > - uint32_t obj_node0 = rand() % 100, obj_node1; > + uint32_t obj_node0 = rte_rand() % 100, obj_node1; Idem. > struct rte_mbuf *data; > uint8_t second_pass = 0; > uint32_t count = 0; > @@ -496,6 +497,7 @@ test_lookup_functions(void) > printf("Test number of edges for node = %s failed Expected = %d, got %d\n", > tm->test_node[i].node.name, > tm->test_node[i].node.nb_edges, count); > + free(next_edges); > return -1; > } > > @@ -505,6 +507,7 @@ test_lookup_functions(void) > printf("Edge name miss match, expected = %s got = %s\n", > tm->test_node[i].node.next_nodes[j], > next_edges[j]); > + free(next_edges); > return -1; > } > } > -- > 2.17.1 > -- David Marchand