Pull the fix from procfs_vnops.c:1.27 also to linprocfs
authorSimon Schubert <corecode@dragonflybsd.org>
Tue, 31 Jan 2006 02:15:10 +0000 (02:15 +0000)
committerSimon Schubert <corecode@dragonflybsd.org>
Tue, 31 Jan 2006 02:15:10 +0000 (02:15 +0000)
sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c

index 10af631..5155ad2 100644 (file)
@@ -39,7 +39,7 @@
  *     @(#)procfs_vnops.c      8.18 (Berkeley) 5/21/95
  *
  * $FreeBSD: src/sys/i386/linux/linprocfs/linprocfs_vnops.c,v 1.3.2.5 2001/08/12 14:29:19 rwatson Exp $
- * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c,v 1.25 2006/01/22 04:44:18 swildner Exp $
+ * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c,v 1.26 2006/01/31 02:15:10 corecode Exp $
  */
 
 /*
@@ -935,10 +935,12 @@ linprocfs_readdir_root(struct vop_readdir_args *ap)
                        break;
                }
 
-               PHOLD(p);
+               if (p != NULL)
+                       PHOLD(p);
                retval = vop_write_dirent(&error, uio,
                    d_ino, d_type, d_namlen, d_name);
-               PRELE(p);
+               if (p != NULL)
+                       PRELE(p);
                if (retval)
                        break;
        }