Merge from vmlocking: in cdev_tty() check d_tty != NULL.
This commit is contained in:
parent
1d7050e5e2
commit
d50d28b794
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: subr_devsw.c,v 1.11 2007/07/09 21:10:55 ad Exp $ */
|
||||
/* $NetBSD: subr_devsw.c,v 1.12 2007/10/08 16:54:09 ad Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001, 2002, 2007 The NetBSD Foundation, Inc.
|
||||
|
@ -76,7 +76,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: subr_devsw.c,v 1.11 2007/07/09 21:10:55 ad Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: subr_devsw.c,v 1.12 2007/10/08 16:54:09 ad Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
|
@ -795,6 +795,10 @@ cdev_tty(dev_t dev)
|
|||
if ((d = cdevsw_lookup(dev)) == NULL)
|
||||
return NULL;
|
||||
|
||||
/* XXX Check if necessary. */
|
||||
if (d->d_tty == NULL)
|
||||
return NULL;
|
||||
|
||||
DEV_LOCK(d);
|
||||
rv = (*d->d_tty)(dev);
|
||||
DEV_UNLOCK(d);
|
||||
|
|
Loading…
Reference in New Issue