Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm CID-1427737: Pacify coverity using KASSERT
details: https://anonhg.NetBSD.org/src/rev/e306e2540579
branches: trunk
changeset: 358897:e306e2540579
user: christos <christos%NetBSD.org@localhost>
date: Sun Jan 21 17:58:43 2018 +0000
description:
CID-1427737: Pacify coverity using KASSERT
diffstat:
sys/uvm/uvm_physseg.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diffs (33 lines):
diff -r 2636611cfcad -r e306e2540579 sys/uvm/uvm_physseg.c
--- a/sys/uvm/uvm_physseg.c Sun Jan 21 17:34:33 2018 +0000
+++ b/sys/uvm/uvm_physseg.c Sun Jan 21 17:58:43 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_physseg.c,v 1.8 2017/03/19 23:30:39 riastradh Exp $ */
+/* $NetBSD: uvm_physseg.c,v 1.9 2018/01/21 17:58:43 christos Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -1147,9 +1147,9 @@
struct uvm_physseg *seg;
struct vm_page *pgs = NULL;
- seg = HANDLE_TO_PHYSSEG_NODE(upm);
+ KASSERT(pages > 0);
- KASSERT(pages > 0);
+ seg = HANDLE_TO_PHYSSEG_NODE(upm);
if (__predict_false(seg->ext == NULL)) {
/*
@@ -1161,7 +1161,10 @@
*/
KASSERT(uvm.page_init_done != true);
- seg->ext = HANDLE_TO_PHYSSEG_NODE(uvm_physseg_get_prev(upm))->ext;
+ uvm_physseg_t upmp = uvm_physseg_get_prev(upm);
+ KASSERT(upmp != UVM_PHYSSEG_TYPE_INVALID);
+
+ seg->ext = HANDLE_TO_PHYSSEG_NODE(upmp)->ext;
KASSERT(seg->ext != NULL);
}
Home |
Main Index |
Thread Index |
Old Index