Fix missing unlock on double nested monitors return path
Subsystems (2)
Gabriele Monaco
maintainerPATCH 1/1 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.
Fixes cb85c660fcd4 ("rv: Add option for nested monitors and include sched")
Reported-by kernel test robot <[email protected]>
Reported-by Julia Lawall <[email protected]>
Signed-off-by Gabriele Monaco <[email protected]>
---
This fix is not critical since currently no nested monitor registers nested monitors and doing so would require another review for inclusion in the kernel code.
kernel/trace/rv/rv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/trace/rv/rv.c +2 -1
@@ -809,7 +809,8 @@ int rv_register_monitor(struct rv_monitor *monitor, struct rv_monitor *parent)if (p &&rv_is_nested_monitor (p)) {pr_info ("Parent monitor %s is already nested, cannot nest further\n" , parent->name); -return -EINVAL ; + retval = -EINVAL ; + goto out_unlock; } r =kzalloc (sizeof (struct rv_monitor_def ),GFP_KERNEL );
base-commit: acc4d5ff0b61eb1715c498b6536c38c1feb7f3c1
Signature · 1 line
2.49.0