Commit 9b509676 authored by Zhen Ni's avatar Zhen Ni Committed by Gabriele Monaco
Browse files

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: 24cbfe18 ("rv: Merge struct rv_monitor_def into struct rv_monitor")
Signed-off-by: default avatarZhen Ni <zhen.ni@easystack.cn>
Reviewed-by: default avatarGabriele Monaco <gmonaco@redhat.com>
Reviewed-by: default avatarNam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/r/20250903065112.1878330-1-zhen.ni@easystack.cn


Signed-off-by: default avatarGabriele Monaco <gmonaco@redhat.com>
parent 3afaff7a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)