]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - fs/namei.c
propagate error from get_empty_filp() to its callers
[mirror_ubuntu-jammy-kernel.git] / fs / namei.c
index 43a97ee1d4c864e4053f86aec5830e037721d125..e0a33f598cdf18e651d29d82939f6243bef38036 100644 (file)
@@ -2778,7 +2778,7 @@ retry_lookup:
                        goto out;
 
                if ((*opened & FILE_CREATED) ||
-                   !S_ISREG(file->f_path.dentry->d_inode->i_mode))
+                   !S_ISREG(file_inode(file)->i_mode))
                        will_truncate = false;
 
                audit_inode(name, file->f_path.dentry, 0);
@@ -2941,8 +2941,8 @@ static struct file *path_openat(int dfd, struct filename *pathname,
        int error;
 
        file = get_empty_filp();
-       if (!file)
-               return ERR_PTR(-ENFILE);
+       if (IS_ERR(file))
+               return file;
 
        file->f_flags = op->open_flag;