Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/arch/x86/x86 Also pull up r1.267, requested by mrg in...



details:   https://anonhg.NetBSD.org/src/rev/6e393eb90581
branches:  netbsd-8
changeset: 434702:6e393eb90581
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Mar 06 08:45:59 2018 +0000

description:
Also pull up r1.267, requested by mrg in ticket #593: avoid a NULL pointer
deref and simplify.

diffstat:

 sys/arch/x86/x86/pmap.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r d4ef64fa70f1 -r 6e393eb90581 sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c   Thu Mar 01 19:09:02 2018 +0000
+++ b/sys/arch/x86/x86/pmap.c   Tue Mar 06 08:45:59 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.245.6.2 2018/02/27 09:07:33 martin Exp $    */
+/*     $NetBSD: pmap.c,v 1.245.6.3 2018/03/06 08:45:59 martin Exp $    */
 
 /*-
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.245.6.2 2018/02/27 09:07:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.245.6.3 2018/03/06 08:45:59 martin Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1737,8 +1737,8 @@
         * since the first pv entry is stored in the pmap_page.
         */
 
-       return (pp->pp_flags & PP_EMBEDDED) != 0 ||
-               !LIST_EMPTY(&pp->pp_head.pvh_list);
+       return pp && ((pp->pp_flags & PP_EMBEDDED) != 0 ||
+           !LIST_EMPTY(&pp->pp_head.pvh_list));
 }
 
 /*
@@ -4123,7 +4123,7 @@
         */
 
        bool needpves = pmap_pp_needs_pve(new_pp);
-       if (new_pp && needpves) {
+       if (needpves) {
                new_pve = pool_cache_get(&pmap_pv_cache, PR_NOWAIT);
                new_sparepve = pool_cache_get(&pmap_pv_cache, PR_NOWAIT);
        } else {



Home | Main Index | Thread Index | Old Index