Skip to content

Commit dbffcd0

Browse files
Rik van Rieltorvalds
authored andcommitted
mm: change confusing #ifdef use in __access_remote_vm
This patch changes confusing #ifdef use in __access_remote_vm into merely ugly #ifdef use. Addresses bug https://bugzilla.kernel.org/show_bug.cgi?id=81651 Signed-off-by: Rik van Riel <riel@redhat.com> Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 68b5a65 commit dbffcd0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎mm/memory.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3613,21 +3613,23 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
36133613
ret = get_user_pages(tsk, mm, addr, 1,
36143614
write, 1, &page, &vma);
36153615
if (ret <= 0) {
3616+
#ifndef CONFIG_HAVE_IOREMAP_PROT
3617+
break;
3618+
#else
36163619
/*
36173620
* Check if this is a VM_IO | VM_PFNMAP VMA, which
36183621
* we can access using slightly different code.
36193622
*/
3620-
#ifdef CONFIG_HAVE_IOREMAP_PROT
36213623
vma = find_vma(mm, addr);
36223624
if (!vma || vma->vm_start > addr)
36233625
break;
36243626
if (vma->vm_ops && vma->vm_ops->access)
36253627
ret = vma->vm_ops->access(vma, addr, buf,
36263628
len, write);
36273629
if (ret <= 0)
3628-
#endif
36293630
break;
36303631
bytes = ret;
3632+
#endif
36313633
} else {
36323634
bytes = len;
36333635
offset = addr & (PAGE_SIZE-1);

0 commit comments

Comments
 (0)