kernel - VM rework (fix introduced bug)
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 11 May 2019 16:04:25 +0000 (09:04 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 11 May 2019 16:04:25 +0000 (09:04 -0700)
* Fix a null-pointer dereferencing bug in vm_object_madvise() introduced
  in recent commits.

sys/vm/vm_object.c

index c923bbc..327213b 100644 (file)
@@ -1360,11 +1360,8 @@ relookup:
                        /*
                         * There may be swap even if there is no backing page
                         */
-                       if (advise == MADV_FREE &&
-                           object->type == OBJT_SWAP &&
-                           m->object == object) {
+                       if (advise == MADV_FREE && object->type == OBJT_SWAP)
                                swap_pager_freespace(object, pindex, 1);
-                       }
                        continue;
                }