OSDN Git Service

arch/arc/kernel/troubleshoot: use vma_lookup() instead of find_vma()
authorLiam Howlett <liam.howlett@oracle.com>
Tue, 29 Jun 2021 02:38:56 +0000 (19:38 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Jun 2021 17:53:51 +0000 (10:53 -0700)
Use vma_lookup() to find the VMA at a specific address.  As vma_lookup()
will return NULL if the address is not within any VMA, the start address
no longer needs to be validated.

Link: https://lkml.kernel.org/r/20210521174745.2219620-4-Liam.Howlett@Oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/arc/kernel/troubleshoot.c

index a331bb5..7654c2e 100644 (file)
@@ -83,12 +83,12 @@ static void show_faulting_vma(unsigned long address)
         * non-inclusive vma
         */
        mmap_read_lock(active_mm);
-       vma = find_vma(active_mm, address);
+       vma = vma_lookup(active_mm, address);
 
-       /* check against the find_vma( ) behaviour which returns the next VMA
-        * if the container VMA is not found
+       /* Lookup the vma at the address and report if the container VMA is not
+        * found
         */
-       if (vma && (vma->vm_start <= address)) {
+       if (vma) {
                char buf[ARC_PATH_MAX];
                char *nm = "?";