Module Name: src Committed By: maxv Date: Wed Mar 28 19:50:57 UTC 2018
Modified Files: src/sys/arch/x86/x86: spectre.c Log Message: oldlwp can be NULL, so ensure it isn't. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/x86/spectre.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/x86/spectre.c diff -u src/sys/arch/x86/x86/spectre.c:1.2 src/sys/arch/x86/x86/spectre.c:1.3 --- src/sys/arch/x86/x86/spectre.c:1.2 Wed Mar 28 16:02:49 2018 +++ src/sys/arch/x86/x86/spectre.c Wed Mar 28 19:50:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: spectre.c,v 1.2 2018/03/28 16:02:49 maxv Exp $ */ +/* $NetBSD: spectre.c,v 1.3 2018/03/28 19:50:57 maxv Exp $ */ /* * Copyright (c) 2018 NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.2 2018/03/28 16:02:49 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.3 2018/03/28 19:50:57 maxv Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -69,7 +69,7 @@ speculation_barrier(struct lwp *oldlwp, /* * From kernel thread to kernel thread, no need for a barrier. */ - if ((oldlwp->l_flag & LW_SYSTEM) && + if ((oldlwp != NULL && (oldlwp->l_flag & LW_SYSTEM)) && (newlwp->l_flag & LW_SYSTEM)) return;