svn commit: r227212 - stable/8/sys/fs/devfs
Konstantin Belousov
kib at FreeBSD.org
Sun Nov 6 13:17:37 UTC 2011
Author: kib
Date: Sun Nov 6 13:17:37 2011
New Revision: 227212
URL: http://svn.freebsd.org/changeset/base/227212
Log:
MFC r227062:
Fix kernel panic when d_fdopen csw method is called for NULL fp.
This may happen when kernel consumer calls VOP_OPEN().
Modified:
stable/8/sys/fs/devfs/devfs_vnops.c
Directory Properties:
stable/8/sys/ (props changed)
Modified: stable/8/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- stable/8/sys/fs/devfs/devfs_vnops.c Sun Nov 6 13:06:31 2011 (r227211)
+++ stable/8/sys/fs/devfs/devfs_vnops.c Sun Nov 6 13:17:37 2011 (r227212)
@@ -982,6 +982,10 @@ devfs_open(struct vop_open_args *ap)
dsw = dev_refthread(dev, &ref);
if (dsw == NULL)
return (ENXIO);
+ if (fp == NULL && dsw->d_fdopen != NULL) {
+ dev_relthread(dev, ref);
+ return (ENXIO);
+ }
vlocked = VOP_ISLOCKED(vp);
VOP_UNLOCK(vp, 0);
More information about the svn-src-stable-8
mailing list