ashmem: account for older kernel which don't have vma_set_anonymous

Was first introduced in 4.18 and needs to be called from ashmem when
running with a kernel >= 4.18.
This commit is contained in:
Simon Fels 2018-09-02 12:10:07 +02:00
parent 0391d4fe2f
commit 0e31fc5ec5
1 changed files with 4 additions and 0 deletions

View File

@ -419,9 +419,13 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
fput(asma->file); fput(asma->file);
goto out; goto out;
} }
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
} else { } else {
vma_set_anonymous(vma); vma_set_anonymous(vma);
} }
#else
}
#endif
if (vma->vm_file) if (vma->vm_file)
fput(vma->vm_file); fput(vma->vm_file);