Stopgap XXX kludge for PR kern/42848 and PR kern/45013.

Someone should really find and fix the real problem,
but it's better to not crash in the meantime.
This commit is contained in:
jakllsch 2012-01-14 20:51:00 +00:00
parent 669638baf1
commit 99e40765f9

View File

@ -1,4 +1,4 @@
/* $NetBSD: ucom.c,v 1.95 2012/01/14 20:41:49 jakllsch Exp $ */
/* $NetBSD: ucom.c,v 1.96 2012/01/14 20:51:00 jakllsch Exp $ */
/*
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.95 2012/01/14 20:41:49 jakllsch Exp $");
__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.96 2012/01/14 20:51:00 jakllsch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -370,6 +370,10 @@ ucomopen(dev_t dev, int flag, int mode, struct lwp *l)
int s, i;
int error;
/* XXX This is a hopefully temporary stopgap for kern/42848. */
if ((flag & (FREAD|FWRITE)) != (FREAD|FWRITE))
return (EINVAL);
if (sc == NULL)
return (ENXIO);