Skip to content

Commit fc0585c

Browse files
glemcorostedt
authored andcommitted
rv: Fix missing unlock on double nested monitors return path
RV doesn't support nested monitors having children monitors themselves and exits with the EINVAL code. However, it returns without unlocking the rv_interface_lock. Unlock the lock before returning from the initialisation function. Cc: Masami Hiramatsu <[email protected]> Link: https://lore.kernel.org/[email protected] Fixes: cb85c66 ("rv: Add option for nested monitors and include sched") Reported-by: kernel test robot <[email protected]> Reported-by: Julia Lawall <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Signed-off-by: Gabriele Monaco <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 023f124 commit fc0585c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/trace/rv/rv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,8 @@ int rv_register_monitor(struct rv_monitor *monitor, struct rv_monitor *parent)
809809
if (p && rv_is_nested_monitor(p)) {
810810
pr_info("Parent monitor %s is already nested, cannot nest further\n",
811811
parent->name);
812-
return -EINVAL;
812+
retval = -EINVAL;
813+
goto out_unlock;
813814
}
814815

815816
r = kzalloc(sizeof(struct rv_monitor_def), GFP_KERNEL);

0 commit comments

Comments
 (0)