[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241124-work-cred-v1-25-f352241c3970@kernel.org>
Date: Sun, 24 Nov 2024 14:44:11 +0100
From: Christian Brauner <brauner@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Christian Brauner <brauner@...nel.org>,
Amir Goldstein <amir73il@...il.com>,
Miklos Szeredi <miklos@...redi.hu>,
linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: [PATCH 25/26] trace: avoid pointless cred reference count bump
No need for the extra reference count bump.
Signed-off-by: Christian Brauner <brauner@...nel.org>
---
kernel/trace/trace_events_user.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c
index c54ae15f425c2c1dad3f8c776027beca2f00a0a5..1ec83a4f19ac038a8580391c291653ab822ce664 100644
--- a/kernel/trace/trace_events_user.c
+++ b/kernel/trace/trace_events_user.c
@@ -1469,7 +1469,7 @@ static int user_event_set_call_visible(struct user_event *user, bool visible)
*/
cred->fsuid = GLOBAL_ROOT_UID;
- old_cred = override_creds(get_new_cred(cred));
+ old_cred = override_creds(cred);
if (visible)
ret = trace_add_event_call(&user->call);
@@ -1477,7 +1477,6 @@ static int user_event_set_call_visible(struct user_event *user, bool visible)
ret = trace_remove_event_call(&user->call);
put_cred(revert_creds(old_cred));
- put_cred(cred);
return ret;
}
--
2.45.2
Powered by blists - more mailing lists