@@ -780,7 +780,7 @@ int __ksmbd_override_fsids(struct ksmbd_work *work,
cred->cap_effective = cap_drop_fs_set(cred->cap_effective);
WARN_ON(work->saved_cred);
- work->saved_cred = override_creds(get_new_cred(cred));
+ work->saved_cred = override_creds(cred);
if (!work->saved_cred) {
abort_creds(cred);
return -EINVAL;
@@ -799,9 +799,7 @@ void ksmbd_revert_fsids(struct ksmbd_work *work)
WARN_ON(!work->saved_cred);
- cred = current_cred();
put_cred(revert_creds(work->saved_cred));
- put_cred(cred);
work->saved_cred = NULL;
}
No need for the extra reference count bump. Signed-off-by: Christian Brauner <brauner@kernel.org> --- fs/smb/server/smb_common.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)