summaryrefslogtreecommitdiffstats
path: root/sys/compat/linprocfs/linprocfs_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/linprocfs/linprocfs_misc.c')
-rw-r--r--sys/compat/linprocfs/linprocfs_misc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/compat/linprocfs/linprocfs_misc.c b/sys/compat/linprocfs/linprocfs_misc.c
index 4babe74..5d78083 100644
--- a/sys/compat/linprocfs/linprocfs_misc.c
+++ b/sys/compat/linprocfs/linprocfs_misc.c
@@ -99,8 +99,13 @@ linprocfs_domeminfo(curp, p, pfs, uio)
*/
memused = cnt.v_wire_count * PAGE_SIZE;
memfree = memtotal - memused;
- swaptotal = swapblist->bl_blocks * 1024; /* XXX why 1024? */
- swapfree = swapblist->bl_root->u.bmu_avail * PAGE_SIZE;
+ if (swapblist == NULL) {
+ swaptotal = 0;
+ swapfree = 0;
+ } else {
+ swaptotal = swapblist->bl_blocks * 1024; /* XXX why 1024? */
+ swapfree = swapblist->bl_root->u.bmu_avail * PAGE_SIZE;
+ }
swapused = swaptotal - swapfree;
memshared = 0;
for (object = TAILQ_FIRST(&vm_object_list); object != NULL;
OpenPOWER on IntegriCloud