diff options
Diffstat (limited to 'fs/proc/inode.c')
| -rw-r--r-- | fs/proc/inode.c | 14 | 
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 28955d4b7218..124fc43c7090 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -292,16 +292,20 @@ proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr,  {  	struct proc_dir_entry *pde = PDE(file_inode(file));  	unsigned long rv = -EIO; -	unsigned long (*get_area)(struct file *, unsigned long, unsigned long, -				  unsigned long, unsigned long) = NULL; +  	if (use_pde(pde)) { +		typeof(proc_reg_get_unmapped_area) *get_area; + +		get_area = pde->proc_fops->get_unmapped_area;  #ifdef CONFIG_MMU -		get_area = current->mm->get_unmapped_area; +		if (!get_area) +			get_area = current->mm->get_unmapped_area;  #endif -		if (pde->proc_fops->get_unmapped_area) -			get_area = pde->proc_fops->get_unmapped_area; +  		if (get_area)  			rv = get_area(file, orig_addr, len, pgoff, flags); +		else +			rv = orig_addr;  		unuse_pde(pde);  	}  	return rv;  | 
