Module Name:    src
Committed By:   bouyer
Date:           Sun Jan 16 12:40:22 UTC 2011

Modified Files:
        src/sys/dev/usb [netbsd-5]: ukbd.c

Log Message:
Pull up following revision(s) (requested by mbalmer in ticket #1513):
        sys/dev/usb/ukbd.c: revision 1.110
Cap h.loc.count at MAXKEYCODE instead of bailing out.  This lets some obscure/
roque keyboards attach.
>From logana...@devio.us (Loganaden Velvindron), thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.101.4.1 -r1.101.4.2 src/sys/dev/usb/ukbd.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/ukbd.c
diff -u src/sys/dev/usb/ukbd.c:1.101.4.1 src/sys/dev/usb/ukbd.c:1.101.4.2
--- src/sys/dev/usb/ukbd.c:1.101.4.1	Sun Feb 14 13:58:32 2010
+++ src/sys/dev/usb/ukbd.c	Sun Jan 16 12:40:22 2011
@@ -1,4 +1,4 @@
-/*      $NetBSD: ukbd.c,v 1.101.4.1 2010/02/14 13:58:32 bouyer Exp $        */
+/*      $NetBSD: ukbd.c,v 1.101.4.2 2011/01/16 12:40:22 bouyer Exp $        */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.101.4.1 2010/02/14 13:58:32 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.101.4.2 2011/01/16 12:40:22 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -869,7 +869,7 @@
 			if (h.loc.size != 8)
 				return ("key code size != 8");
 			if (h.loc.count > MAXKEYCODE)
-				return ("too many key codes");
+				h.loc.count = MAXKEYCODE;
 			if (h.loc.pos % 8 != 0)
 				return ("key codes not on byte boundary");
 			if (sc->sc_nkeycode != 0)

Reply via email to