MT#55283 compile fix for kernels < 5.14

Change-Id: I7c996a7089089e429185462807d565fc673e0f55
pull/1826/head
Richard Fuchs 2 years ago
parent 96fa75d345
commit 649485face

@ -1822,7 +1822,13 @@ static const struct vm_operations_struct vm_mmap_ops = {
static void *shm_map_resolve(void *p, size_t size) {
struct vm_area_struct *vma;
// XXX is there a better way to map this to the kernel address?
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
vma = vma_lookup(current->mm, (unsigned long) p);
#else
vma = find_vma(current->mm, (unsigned long) p);
if (vma && (unsigned long) p < vma->vm_start)
vma = NULL;
#endif
if (!vma)
return NULL;
if (!vma->vm_private_data)

Loading…
Cancel
Save