Fixed null pointer panic for accessing "meminfo" when there is no swap.
This commit is contained in:
parent
b10fc2ddef
commit
c6e4d7c5ba
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user