From: Zhen Ni Date: Wed, 3 Sep 2025 06:51:12 +0000 (+0800) Subject: rv: Fix missing mutex unlock in rv_register_monitor() X-Git-Tag: v6.17-rc7~17^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9b5096761c184b3923ae45c5e82da31005a765c7;p=thirdparty%2Fkernel%2Fstable.git rv: Fix missing mutex unlock in rv_register_monitor() If create_monitor_dir() fails, the function returns directly without releasing rv_interface_lock. This leaves the mutex locked and causes subsequent monitor registration attempts to deadlock. Fix it by making the error path jump to out_unlock, ensuring that the mutex is always released before returning. Fixes: 24cbfe18d55a ("rv: Merge struct rv_monitor_def into struct rv_monitor") Signed-off-by: Zhen Ni Reviewed-by: Gabriele Monaco Reviewed-by: Nam Cao Link: https://lore.kernel.org/r/20250903065112.1878330-1-zhen.ni@easystack.cn Signed-off-by: Gabriele Monaco --- diff --git a/kernel/trace/rv/rv.c b/kernel/trace/rv/rv.c index b341445b8fbdf..48338520376f9 100644 --- a/kernel/trace/rv/rv.c +++ b/kernel/trace/rv/rv.c @@ -805,7 +805,7 @@ int rv_register_monitor(struct rv_monitor *monitor, struct rv_monitor *parent) retval = create_monitor_dir(monitor, parent); if (retval) - return retval; + goto out_unlock; /* keep children close to the parent for easier visualisation */ if (parent)