Skip to content

Commit

Permalink
rv: Unlock on error path in rv_unregister_reactor()
Browse files Browse the repository at this point in the history
Unlock the "rv_interface_lock" mutex before returning.

Link: https://lkml.kernel.org/r/YuvYzNfGMgV+PIhd@kili

Fixes: 04acadc ("rv: Add runtime reactors interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
  • Loading branch information
Dan Carpenter authored and Steven Rostedt (Google) committed Aug 5, 2022
1 parent 09794a5 commit f1a15b9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/trace/rv/rv_reactors.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ int rv_register_reactor(struct rv_reactor *reactor)
int rv_unregister_reactor(struct rv_reactor *reactor)
{
struct rv_reactor_def *ptr, *next;
int ret = 0;

mutex_lock(&rv_interface_lock);

Expand All @@ -343,13 +344,14 @@ int rv_unregister_reactor(struct rv_reactor *reactor)
ptr->reactor->name, ptr->counter);
printk(KERN_WARNING "rv: the rv_reactor %s cannot be removed\n",
ptr->reactor->name);
return -EBUSY;
ret = -EBUSY;
break;
}
}
}

mutex_unlock(&rv_interface_lock);
return 0;
return ret;
}

/*
Expand Down

0 comments on commit f1a15b9

Please sign in to comment.