* [PATCH] rv: Fix missing unlock on double nested monitors return path
@ 2025-04-02 7:13 Gabriele Monaco
0 siblings, 0 replies; only message in thread
From: Gabriele Monaco @ 2025-04-02 7:13 UTC (permalink / raw)
To: linux-kernel, Steven Rostedt, Masami Hiramatsu, Gabriele Monaco,
linux-trace-kernel
Cc: kernel test robot, Julia Lawall
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 <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Closes: https://lore.kernel.org/r/202503310200.UBXGitB4-lkp@intel.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
---
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(-)
diff --git a/kernel/trace/rv/rv.c b/kernel/trace/rv/rv.c
index 50344aa9f7f93..968c5c3b02464 100644
--- a/kernel/trace/rv/rv.c
+++ b/kernel/trace/rv/rv.c
@@ -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
--
2.49.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-02 7:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-02 7:13 [PATCH] rv: Fix missing unlock on double nested monitors return path Gabriele Monaco
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®