diff mbox series

[4/8] bprm_fill_uid(): don't open-code file_inode()

Message ID YwFBO19tkIUm49Zs@ZenIV (mailing list archive)
State New, archived
Headers show
Series [1/8] ibmvmc: don't open-code file_inode() | expand

Commit Message

Al Viro Aug. 20, 2022, 8:16 p.m. UTC
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/exec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fs/exec.c b/fs/exec.c
index f793221f4eb6..c1867122204a 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1595,7 +1595,7 @@  static void bprm_fill_uid(struct linux_binprm *bprm, struct file *file)
 {
 	/* Handle suid and sgid on files */
 	struct user_namespace *mnt_userns;
-	struct inode *inode;
+	struct inode *inode = file_inode(file);
 	unsigned int mode;
 	kuid_t uid;
 	kgid_t gid;
@@ -1606,7 +1606,6 @@  static void bprm_fill_uid(struct linux_binprm *bprm, struct file *file)
 	if (task_no_new_privs(current))
 		return;
 
-	inode = file->f_path.dentry->d_inode;
 	mode = READ_ONCE(inode->i_mode);
 	if (!(mode & (S_ISUID|S_ISGID)))
 		return;