trace: use prepare credential guard
Use the prepare credential guard for allocating a new set of credentials. Link: https://patch.msgid.link/20251103-work-creds-guards-prepare_creds-v1-11-b447b82f2c9b@kernel.org Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
545985dd37
commit
2ed6a34de9
@ -1451,10 +1451,8 @@ static int user_event_set_call_visible(struct user_event *user, bool visible)
|
||||
{
|
||||
int ret;
|
||||
const struct cred *old_cred;
|
||||
struct cred *cred;
|
||||
|
||||
cred = prepare_creds();
|
||||
|
||||
CLASS(prepare_creds, cred)();
|
||||
if (!cred)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -1477,7 +1475,6 @@ static int user_event_set_call_visible(struct user_event *user, bool visible)
|
||||
ret = trace_remove_event_call(&user->call);
|
||||
|
||||
revert_creds(old_cred);
|
||||
put_cred(cred);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user