Module Name:    src
Committed By:   jakllsch
Date:           Sat Jan 14 20:51:00 UTC 2012

Modified Files:
        src/sys/dev/usb: ucom.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/usb/ucom.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ucom.c
diff -u src/sys/dev/usb/ucom.c:1.95 src/sys/dev/usb/ucom.c:1.96
--- src/sys/dev/usb/ucom.c:1.95	Sat Jan 14 20:41:49 2012
+++ src/sys/dev/usb/ucom.c	Sat Jan 14 20:51:00 2012
@@ -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, 
 	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);
 

Reply via email to