proc: Supply a function to remove a proc entry by PDE
[platform/adaptation/renesas_rcar/renesas_kernel.git] / fs / file_table.c
index cd76d4f..cd4d87a 100644 (file)
@@ -173,9 +173,10 @@ struct file *alloc_file(struct path *path, fmode_t mode,
 
        file = get_empty_filp();
        if (IS_ERR(file))
-               return NULL;
+               return file;
 
        file->f_path = *path;
+       file->f_inode = path->dentry->d_inode;
        file->f_mapping = path->dentry->d_inode->i_mapping;
        file->f_mode = mode;
        file->f_op = fop;
@@ -258,6 +259,7 @@ static void __fput(struct file *file)
                drop_file_write_access(file);
        file->f_path.dentry = NULL;
        file->f_path.mnt = NULL;
+       file->f_inode = NULL;
        file_free(file);
        dput(dentry);
        mntput(mnt);