Source-Changes-HG archive

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

[src/trunk]: src/sys/miscfs/genfs Fix (harmless) uninitialized variable: 'pg'...



details:   https://anonhg.NetBSD.org/src/rev/250a43df042c
branches:  trunk
changeset: 1000166:250a43df042c
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu Jul 11 16:59:14 2019 +0000

description:
Fix (harmless) uninitialized variable: 'pg' could be 'endm', in which case
'pg->uobject' would not be initialized. Just invert the two last conditions
of the KASSERT.

ok hannken@

diffstat:

 sys/miscfs/genfs/genfs_io.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 6bf8b8322132 -r 250a43df042c sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c       Thu Jul 11 15:21:46 2019 +0000
+++ b/sys/miscfs/genfs/genfs_io.c       Thu Jul 11 16:59:14 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfs_io.c,v 1.74 2018/12/10 21:10:52 jdolecek Exp $   */
+/*     $NetBSD: genfs_io.c,v 1.75 2019/07/11 16:59:14 maxv Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.74 2018/12/10 21:10:52 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.75 2019/07/11 16:59:14 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -993,8 +993,8 @@
                 * if the current page is not interesting, move on to the next.
                 */
 
-               KASSERT(pg == NULL || pg->uobject == uobj ||
-                   (pg->flags & PG_MARKER) != 0);
+               KASSERT(pg == NULL || (pg->flags & PG_MARKER) != 0 ||
+                   pg->uobject == uobj);
                KASSERT(pg == NULL ||
                    (pg->flags & (PG_RELEASED|PG_PAGEOUT)) == 0 ||
                    (pg->flags & (PG_BUSY|PG_MARKER)) != 0);



Home | Main Index | Thread Index | Old Index