Merge tag 'media/v5.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[linux-block.git] / drivers / staging / media / atomisp / pci / hmm / hmm_bo.c
index 64bf6b8fc7cc908085611cdcd9718c21551d5057..4fb9bfdd2f4cee1506fce817d214b5a67c490143 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Support for Medifield PNW Camera Imaging ISP subsystem.
  *
@@ -659,6 +660,8 @@ static void free_private_bo_pages(struct hmm_buffer_object *bo,
                                break;
                        }
 
+                       /* fall through */
+
                /*
                 * if dynamic memory pool doesn't exist, need to free
                 * pages to system directly.
@@ -893,9 +896,9 @@ static int alloc_user_pages(struct hmm_buffer_object *bo,
        }
 
        mutex_unlock(&bo->mutex);
-       down_read(&current->mm->mmap_sem);
+       mmap_read_lock(current->mm);
        vma = find_vma(current->mm, (unsigned long)userptr);
-       up_read(&current->mm->mmap_sem);
+       mmap_read_unlock(current->mm);
        if (!vma) {
                dev_err(atomisp_dev, "find_vma failed\n");
                kfree(bo->page_obj);