gud: MobiCoreDriver: use mmap_lock instead of mmap_sem
We backported c2bad05b7b ("BACKPORT:
mmap locking API: rename mmap_sem to mmap_lock"), which renames the
mm_struct mmap_sem field to mmap_lock
Change-Id: Iaea6ee34f78ab721c09aae70cd30792f2c2a6584
This commit is contained in:
1 parent
f36e8c975f
commit
100203e161
1 file changed
-8
@@ -536,11 +536,7 @@ struct tee_mmu *tee_mmu_create(struct mm_struct *mm,
|
||||
long gup_ret;
|
||||
|
||||
/* Buffer was allocated in user space */
|
||||
#if KERNEL_VERSION(5, 7, 19) < LINUX_VERSION_CODE
|
||||
down_read(&mm->mmap_lock);
|
||||
#else
|
||||
down_read(&mm->mmap_sem);
|
||||
#endif
|
||||
/*
|
||||
* Always try to map read/write from a Linux PoV, so
|
||||
* Linux creates (page faults) the underlying pages if
|
||||
@@ -558,11 +554,7 @@ struct tee_mmu *tee_mmu_create(struct mm_struct *mm,
|
||||
(uintptr_t)reader,
|
||||
nr_pages, 0, pages);
|
||||
}
|
||||
#if KERNEL_VERSION(5, 7, 19) < LINUX_VERSION_CODE
|
||||
up_read(&mm->mmap_lock);
|
||||
#else
|
||||
up_read(&mm->mmap_sem);
|
||||
#endif
|
||||
if (gup_ret < 0) {
|
||||
ret = gup_ret;
|
||||
mc_dev_err(ret, "failed to get user pages @%p",
|
||||
|
||||
Reference in new issue
Block a user