Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7-nhusb]: src/sys/dev/usb revision 1.25
details: https://anonhg.NetBSD.org/src/rev/600c700bad3f
branches: netbsd-7-nhusb
changeset: 801047:600c700bad3f
user: skrll <skrll%NetBSD.org@localhost>
date: Fri Mar 31 10:14:06 2017 +0000
description:
revision 1.25
fix off by one
diffstat:
sys/dev/usb/uhso.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (46 lines):
diff -r 29c28adb4326 -r 600c700bad3f sys/dev/usb/uhso.c
--- a/sys/dev/usb/uhso.c Fri Mar 31 10:13:09 2017 +0000
+++ b/sys/dev/usb/uhso.c Fri Mar 31 10:14:06 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uhso.c,v 1.16.6.3 2017/03/31 09:38:05 skrll Exp $ */
+/* $NetBSD: uhso.c,v 1.16.6.4 2017/03/31 10:14:06 skrll Exp $ */
/*-
* Copyright (c) 2009 Iain Hibbert
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.16.6.3 2017/03/31 09:38:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.16.6.4 2017/03/31 10:14:06 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -641,14 +641,14 @@
switch (hd->type) {
case UHSOTYPE_DEFAULT:
- if (ifnum > __arraycount(uhso_spec_default))
+ if (ifnum >= __arraycount(uhso_spec_default))
break;
*spec = uhso_spec_default[ifnum];
return 1;
case UHSOTYPE_ICON321:
- if (ifnum > __arraycount(uhso_spec_icon321))
+ if (ifnum >= __arraycount(uhso_spec_icon321))
break;
*spec = uhso_spec_icon321[ifnum];
@@ -665,8 +665,8 @@
if (status != USBD_NORMAL_COMPLETION)
break;
- if (ifnum > __arraycount(config)
- || config[ifnum] > __arraycount(uhso_spec_config))
+ if (ifnum >= __arraycount(config)
+ || config[ifnum] >= __arraycount(uhso_spec_config))
break;
*spec = uhso_spec_config[config[ifnum]];
Home |
Main Index |
Thread Index |
Old Index