svn commit: r227213 - stable/7/sys/fs/devfs
Konstantin Belousov
kib at FreeBSD.org
Sun Nov 6 13:35:56 UTC 2011
Author: kib
Date: Sun Nov 6 13:35:55 2011
New Revision: 227213
URL: http://svn.freebsd.org/changeset/base/227213
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/7/sys/fs/devfs/devfs_vnops.c
Directory Properties:
stable/7/sys/ (props changed)
Modified: stable/7/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- stable/7/sys/fs/devfs/devfs_vnops.c Sun Nov 6 13:17:37 2011 (r227212)
+++ stable/7/sys/fs/devfs/devfs_vnops.c Sun Nov 6 13:35:55 2011 (r227213)
@@ -887,6 +887,10 @@ devfs_open(struct vop_open_args *ap)
dsw = dev_refthread(dev);
if (dsw == NULL)
return (ENXIO);
+ if (fp == NULL && dsw->d_fdopen != NULL) {
+ dev_relthread(dev);
+ return (ENXIO);
+ }
/* XXX: Special casing of ttys for deadfs. Probably redundant. */
if (dsw->d_flags & D_TTY)
More information about the svn-src-all
mailing list