Currently if ikm_setup_trace_instance() fails, the tool returns without
any cleanup, if rv was called with both -t and -r, this means the
reactor is not going to be cleared.

Jump to the cleanup label to restore the reactor if necessary.

Signed-off-by: Gabriele Monaco <[email protected]>
---
 tools/verification/rv/src/in_kernel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/verification/rv/src/in_kernel.c 
b/tools/verification/rv/src/in_kernel.c
index 95adae321c11..131a6787d639 100644
--- a/tools/verification/rv/src/in_kernel.c
+++ b/tools/verification/rv/src/in_kernel.c
@@ -809,7 +809,7 @@ int ikm_run_monitor(char *monitor_name, int argc, char 
**argv)
        if (config_trace) {
                inst = ikm_setup_trace_instance(nested_name);
                if (!inst)
-                       return -1;
+                       goto out_free_instance;
        }
 
        retval = ikm_enable(full_name);
-- 
2.54.0


Reply via email to