From 1de4b24980d043cbb0e0d13fcff661c8dcea6773 Mon Sep 17 00:00:00 2001 From: skrll Date: Mon, 14 Oct 2013 18:15:12 +0000 Subject: [PATCH] Handle an error from uhidev_get_report in ucycom_get_cfg --- sys/dev/usb/ucycom.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/ucycom.c b/sys/dev/usb/ucycom.c index 43dd7deef4bf..b51daba9fa3d 100644 --- a/sys/dev/usb/ucycom.c +++ b/sys/dev/usb/ucycom.c @@ -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 -__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 #include @@ -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];