Module Name: src Committed By: snj Date: Sat Jan 9 01:37:04 UTC 2010
Modified Files: src/sys/dev/usb [netbsd-5]: uhidev.c Log Message: Pull up following revision(s) (requested by jakllsch in ticket #1219): sys/dev/usb/uhidev.c: revision 1.46 The Dell DRAC5 gives us a zero-length report immediately following a normal report. Thus, ignore zero-length reports. Move some related report size insanity checking into the UHIDEV_DEBUG case. Should fix PR/39911. To generate a diff of this commit: cvs rdiff -u -r1.42.8.1 -r1.42.8.2 src/sys/dev/usb/uhidev.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/uhidev.c diff -u src/sys/dev/usb/uhidev.c:1.42.8.1 src/sys/dev/usb/uhidev.c:1.42.8.2 --- src/sys/dev/usb/uhidev.c:1.42.8.1 Fri Nov 27 08:54:13 2009 +++ src/sys/dev/usb/uhidev.c Sat Jan 9 01:37:04 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uhidev.c,v 1.42.8.1 2009/11/27 08:54:13 sborrill Exp $ */ +/* $NetBSD: uhidev.c,v 1.42.8.2 2010/01/09 01:37:04 snj Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.42.8.1 2009/11/27 08:54:13 sborrill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhidev.c,v 1.42.8.2 2010/01/09 01:37:04 snj Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -475,9 +475,15 @@ rep, scd, scd ? scd->sc_state : 0)); if (!(scd->sc_state & UHIDEV_OPEN)) return; - if (scd->sc_in_rep_size > cc) { - printf("%s: bad input length %d != %d\n", - USBDEVNAME(sc->sc_dev), scd->sc_in_rep_size, cc); +#ifdef UHIDEV_DEBUG + if (scd->sc_in_rep_size != cc) { + DPRINTF(("%s: expected %d bytes, got %d\n", + USBDEVNAME(sc->sc_dev), scd->sc_in_rep_size, cc)); + } +#endif + if (cc == 0) { + DPRINTF(("%s: 0-length input ignored\n", + USBDEVNAME(sc->sc_dev))); return; } #if NRND > 0