From 0e31fc5ec5ff7a6599a04ecf5008e17fc1aa1f7b Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Sun, 2 Sep 2018 12:10:07 +0200 Subject: [PATCH] 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. --- ashmem/ashmem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ashmem/ashmem.c b/ashmem/ashmem.c index 85b576d..cb354dc 100644 --- a/ashmem/ashmem.c +++ b/ashmem/ashmem.c @@ -419,9 +419,13 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma) fput(asma->file); goto out; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) } else { vma_set_anonymous(vma); } +#else + } +#endif if (vma->vm_file) fput(vma->vm_file);