No need for the extra reference count bump. Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx> --- fs/open.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fs/open.c b/fs/open.c index 0a5cd8e74fb9bb4cc484d84096c6123b21acbf16..74ee5e02d68c590475f18f099b188f052f17f555 100644 --- a/fs/open.c +++ b/fs/open.c @@ -447,13 +447,7 @@ static const struct cred *access_override_creds(void) * freeing. */ override_cred->non_rcu = 1; - - old_cred = override_creds(get_new_cred(override_cred)); - - /* override_cred() gets its own ref */ - put_cred(override_cred); - - return old_cred; + return override_creds(override_cred); } static long do_faccessat(int dfd, const char __user *filename, int mode, int flags) -- 2.45.2