mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 09:09:55 -04:00
cred: return old creds from revert_creds_light()
So we can easily convert revert_creds() callers over to drop the reference count explicitly. Link: https://lore.kernel.org/r/20241125-work-cred-v2-2-68b9d38bb5b2@kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -185,9 +185,12 @@ static inline const struct cred *override_creds_light(const struct cred *overrid
|
||||
return old;
|
||||
}
|
||||
|
||||
static inline void revert_creds_light(const struct cred *revert_cred)
|
||||
static inline const struct cred *revert_creds_light(const struct cred *revert_cred)
|
||||
{
|
||||
const struct cred *override_cred = current->cred;
|
||||
|
||||
rcu_assign_pointer(current->cred, revert_cred);
|
||||
return override_cred;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user