summary refs log tree commit diff
path: root/fs/proc/inode.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-10-30 18:42:13 +0100
committerTakashi Iwai <tiwai@suse.de>2013-10-30 18:42:13 +0100
commitc4a4ddaefbef3c5135c3167bd5e067859d71e84c (patch)
tree1c44a7de360774a272495593d2bb67853380da82 /fs/proc/inode.c
parent6fc16e58adf50c0f1e4478538983fb5ff6f453d4 (diff)
parent8723b795aaa0c5f0b9db2099af575f5e089a63f1 (diff)
downloadlinux-c4a4ddaefbef3c5135c3167bd5e067859d71e84c.tar.gz
Merge tag 'asoc-fix-v3.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.12

A few of the Coverity fixes from Takashi, one of which (the wm_hubs one)
is particularly noticable.
Diffstat (limited to 'fs/proc/inode.c')
-rw-r--r--fs/proc/inode.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 9f8ef9b7674d..8eaa1ba793fc 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -288,10 +288,14 @@ static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma)
 static unsigned long proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr, unsigned long len, unsigned long pgoff, unsigned long flags)
 {
 	struct proc_dir_entry *pde = PDE(file_inode(file));
-	int rv = -EIO;
-	unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
+	unsigned long rv = -EIO;
+	unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long) = NULL;
 	if (use_pde(pde)) {
-		get_unmapped_area = pde->proc_fops->get_unmapped_area;
+#ifdef CONFIG_MMU
+		get_unmapped_area = current->mm->get_unmapped_area;
+#endif
+		if (pde->proc_fops->get_unmapped_area)
+			get_unmapped_area = pde->proc_fops->get_unmapped_area;
 		if (get_unmapped_area)
 			rv = get_unmapped_area(file, orig_addr, len, pgoff, flags);
 		unuse_pde(pde);