Skip to content

Commit facc239

Browse files
committed
ovl: avoid pointless cred reference count bump
security_inode_copy_up() allocates a set of new credentials and has taken a reference count. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Jeff Layton <[email protected]> Reviewed-by: Jens Axboe <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 7708f3a commit facc239

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/overlayfs/copy_up.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,15 +741,15 @@ static int ovl_prep_cu_creds(struct dentry *dentry, struct ovl_cu_creds *cc)
741741
return err;
742742

743743
if (cc->new)
744-
cc->old = override_creds(get_new_cred(cc->new));
744+
cc->old = override_creds(cc->new);
745745

746746
return 0;
747747
}
748748

749749
static void ovl_revert_cu_creds(struct ovl_cu_creds *cc)
750750
{
751751
if (cc->new) {
752-
put_cred(revert_creds(cc->old));
752+
revert_creds(cc->old);
753753
put_cred(cc->new);
754754
}
755755
}

0 commit comments

Comments
 (0)