kernel/linprocfs: Fix a panic when accessing /proc/<pid>/maps.
authorSascha Wildner <saw@online.de>
Tue, 21 Aug 2012 20:44:09 +0000 (22:44 +0200)
committerSascha Wildner <saw@online.de>
Tue, 21 Aug 2012 20:46:09 +0000 (22:46 +0200)
Analogous to procfs.

sys/emulation/linux/i386/linprocfs/linprocfs_misc.c

index 0fb4e4f..e592668 100644 (file)
@@ -754,7 +754,8 @@ linprocfs_domaps(struct proc *curp, struct proc *p, struct pfsnode *pfs,
                 * if they happen to be the same).
                 */
                obj = entry->object.vm_object;
-                vm_object_hold(obj);
+               if (obj)
+                       vm_object_hold(obj);
 
                 lobj = obj;
                 while (lobj && (tobj = lobj->backing_object) != NULL) {
@@ -798,7 +799,8 @@ linprocfs_domaps(struct proc *curp, struct proc *p, struct pfsnode *pfs,
 
                if (lobj != obj)
                        vm_object_drop(lobj);
-               vm_object_drop(obj);
+               if (obj)
+                       vm_object_drop(obj);
 
                /*
                 * We cannot safely hold the map locked while accessing