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>
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;
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.
*/
printf("SW Eventdev Selftest Successful.\n");
return 0;
test_fail:
+ free(t);
printf("SW Eventdev Selftest Failed.\n");
return -1;
}