Merge 3.15-rc3 into staging-next
[cascardo/linux.git] / fs / kernfs / file.c
index 98bacd9..40251cd 100644 (file)
@@ -485,6 +485,8 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma)
 
        ops = kernfs_ops(of->kn);
        rc = ops->mmap(of, vma);
+       if (rc)
+               goto out_put;
 
        /*
         * PowerPC's pci_mmap of legacy_mem uses shmem_zero_setup()