From 99e40765f90cec68909ac981335c6a9c01e7e75f Mon Sep 17 00:00:00 2001 From: jakllsch Date: Sat, 14 Jan 2012 20:51:00 +0000 Subject: [PATCH] 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. --- sys/dev/usb/ucom.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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);