If the self test is run and a test fails, the allocated
memory would was not freed. The passing case already freed
this memory correctly.

Fixes: 5e6eb5ccd788 ("event/sw: make test standalone")
Coverity ID: 257044
Cc: pbhagavat...@caviumnetworks.com

Signed-off-by: Harry van Haaren <harry.van.haa...@intel.com>

---
---
 drivers/event/sw/sw_evdev_selftest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/event/sw/sw_evdev_selftest.c 
b/drivers/event/sw/sw_evdev_selftest.c
index 8c2eef5..dbfa29b 100644
--- a/drivers/event/sw/sw_evdev_selftest.c
+++ b/drivers/event/sw/sw_evdev_selftest.c
@@ -3236,6 +3236,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.7.4

Reply via email to