Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm/frame_vector.c: release a semaphore in 'get_vaddr_frames()'

A semaphore is acquired before this check, so we must release it before
leaving.

Link: http://lkml.kernel.org/r/20171211211009.4971-1-christophe.jaillet@wanadoo.fr
Fixes: b7f0554a56f2 ("mm: fail get_vaddr_frames() for filesystem-dax mappings")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: David Sterba <dsterba@suse.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Christophe JAILLET and committed by
Linus Torvalds
1f704fd0 0b265c3b

+4 -2
+4 -2
mm/frame_vector.c
··· 62 62 * get_user_pages_longterm() and disallow it for filesystem-dax 63 63 * mappings. 64 64 */ 65 - if (vma_is_fsdax(vma)) 66 - return -EOPNOTSUPP; 65 + if (vma_is_fsdax(vma)) { 66 + ret = -EOPNOTSUPP; 67 + goto out; 68 + } 67 69 68 70 if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) { 69 71 vec->got_ref = true;