diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index 8f05177c4cb2..8b67c31b34db 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -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 -__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 #include @@ -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);