DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] drivers/event: fix resource leak in selftest
@ 2018-01-22 17:46 Pavan Nikhilesh
  2018-01-23 14:17 ` Van Haaren, Harry
  0 siblings, 1 reply; 3+ messages in thread
From: Pavan Nikhilesh @ 2018-01-22 17:46 UTC (permalink / raw)
  To: jerin.jacob, harry.van.haaren; +Cc: dev, Pavan Nikhilesh

Free resources leak in eventdev selftests.

Coverity issue: 257044
Coverity issue: 257047
Coverity issue: 257009
Fixes: 9ef576176db0 ("test/eventdev: add octeontx multi queue and multi port")
Fixes: 3a17ff401f1e ("test/eventdev: add basic SW tests")
Fixes: 5e6eb5ccd788 ("event/sw: make test standalone")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 drivers/event/octeontx/ssovf_evdev_selftest.c | 4 +++-
 drivers/event/sw/sw_evdev_selftest.c          | 6 +++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/event/octeontx/ssovf_evdev_selftest.c b/drivers/event/octeontx/ssovf_evdev_selftest.c
index 3866ba968..5e012a95a 100644
--- a/drivers/event/octeontx/ssovf_evdev_selftest.c
+++ b/drivers/event/octeontx/ssovf_evdev_selftest.c
@@ -624,8 +624,10 @@ launch_workers_and_wait(int (*master_worker)(void *),
 
 	ret = rte_event_dequeue_timeout_ticks(evdev,
 		rte_rand() % 10000000/* 10ms */, &dequeue_tmo_ticks);
-	if (ret)
+	if (ret) {
+		free(param);
 		return -1;
+	}
 
 	param[0].total_events = &atomic_total_events;
 	param[0].sched_type = sched_type;
diff --git a/drivers/event/sw/sw_evdev_selftest.c b/drivers/event/sw/sw_evdev_selftest.c
index 8c2eef569..78d30e07a 100644
--- a/drivers/event/sw/sw_evdev_selftest.c
+++ b/drivers/event/sw/sw_evdev_selftest.c
@@ -3016,9 +3016,12 @@ static struct rte_mempool *eventdev_func_mempool;
 int
 test_sw_eventdev(void)
 {
-	struct test *t = malloc(sizeof(struct test));
+	struct test *t;
 	int ret;
 
+	t = malloc(sizeof(struct test));
+	if (t == NULL)
+		return -1;
 	/* manually initialize the op, older gcc's complain on static
 	 * initialization of struct elements that are a bitfield.
 	 */
@@ -3236,6 +3239,7 @@ test_sw_eventdev(void)
 	printf("SW Eventdev Selftest Successful.\n");
 	return 0;
 test_fail:
+	free(t);
 	printf("SW Eventdev Selftest Failed.\n");
 	return -1;
 }
-- 
2.16.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] drivers/event: fix resource leak in selftest
  2018-01-22 17:46 [dpdk-dev] [PATCH] drivers/event: fix resource leak in selftest Pavan Nikhilesh
@ 2018-01-23 14:17 ` Van Haaren, Harry
  2018-01-24 18:01   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Van Haaren, Harry @ 2018-01-23 14:17 UTC (permalink / raw)
  To: Pavan Nikhilesh, jerin.jacob; +Cc: dev

> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Monday, January 22, 2018 5:46 PM
> To: jerin.jacob@caviumnetworks.com; Van Haaren, Harry
> <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH] drivers/event: fix resource leak in selftest
> 
> Free resources leak in eventdev selftests.
> 
> Coverity issue: 257044
> Coverity issue: 257047
> Coverity issue: 257009
> Fixes: 9ef576176db0 ("test/eventdev: add octeontx multi queue and multi
> port")
> Fixes: 3a17ff401f1e ("test/eventdev: add basic SW tests")
> Fixes: 5e6eb5ccd788 ("event/sw: make test standalone")
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>

Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] drivers/event: fix resource leak in selftest
  2018-01-23 14:17 ` Van Haaren, Harry
@ 2018-01-24 18:01   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-01-24 18:01 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: dev, Van Haaren, Harry, jerin.jacob

23/01/2018 15:17, Van Haaren, Harry:
> > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> > Sent: Monday, January 22, 2018 5:46 PM
> > To: jerin.jacob@caviumnetworks.com; Van Haaren, Harry
> > <harry.van.haaren@intel.com>
> > Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH] drivers/event: fix resource leak in selftest
> > 
> > Free resources leak in eventdev selftests.
> > 
> > Coverity issue: 257044
> > Coverity issue: 257047
> > Coverity issue: 257009
> > Fixes: 9ef576176db0 ("test/eventdev: add octeontx multi queue and multi
> > port")
> > Fixes: 3a17ff401f1e ("test/eventdev: add basic SW tests")
> > Fixes: 5e6eb5ccd788 ("event/sw: make test standalone")
> > 
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> 
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-24 18:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-22 17:46 [dpdk-dev] [PATCH] drivers/event: fix resource leak in selftest Pavan Nikhilesh
2018-01-23 14:17 ` Van Haaren, Harry
2018-01-24 18:01   ` Thomas Monjalon

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).