Module Name:    src
Committed By:   skrll
Date:           Mon Oct 14 18:15:12 UTC 2013

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

Log Message:
Handle an error from uhidev_get_report in ucycom_get_cfg


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/usb/ucycom.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/ucycom.c
diff -u src/sys/dev/usb/ucycom.c:1.36 src/sys/dev/usb/ucycom.c:1.37
--- src/sys/dev/usb/ucycom.c:1.36	Sun Sep 15 15:06:04 2013
+++ src/sys/dev/usb/ucycom.c	Mon Oct 14 18:15:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucycom.c,v 1.36 2013/09/15 15:06:04 martin Exp $	*/
+/*	$NetBSD: ucycom.c,v 1.37 2013/10/14 18:15:12 skrll Exp $	*/
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.36 2013/09/15 15:06:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.37 2013/10/14 18:15:12 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1096,6 +1096,10 @@ ucycom_get_cfg(struct ucycom_softc *sc)
 
 	err = uhidev_get_report(&sc->sc_hdev, UHID_FEATURE_REPORT,
 	    report, sc->sc_flen);
+	if (err) {
+		DPRINTF(("%s: failed\n", __func__));
+		return;
+	}
 	cfg = report[4];
 	baud = (report[3] << 24) + (report[2] << 16) + (report[1] << 8) +
 	    report[0];

Reply via email to