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:44:44 +0000 (22:44 +0200)
Analogous to procfs.

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

index 7543374..7855f91 100644 (file)
@@ -753,7 +753,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) {
@@ -797,7 +798,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