Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/nvidia fix off by one.



details:   https://anonhg.NetBSD.org/src/rev/9f4725c78b12
branches:  trunk
changeset: 820598:9f4725c78b12
user:      maya <maya%NetBSD.org@localhost>
date:      Thu Jan 12 01:12:08 2017 +0000

description:
fix off by one.

ok riastradh

diffstat:

 sys/arch/arm/nvidia/tegra124_car.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r c4e90330e550 -r 9f4725c78b12 sys/arch/arm/nvidia/tegra124_car.c
--- a/sys/arch/arm/nvidia/tegra124_car.c        Thu Jan 12 01:02:09 2017 +0000
+++ b/sys/arch/arm/nvidia/tegra124_car.c        Thu Jan 12 01:12:08 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra124_car.c,v 1.7 2016/12/17 15:24:35 riastradh Exp $ */
+/* $NetBSD: tegra124_car.c,v 1.8 2017/01/12 01:12:08 maya Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.7 2016/12/17 15:24:35 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.8 2017/01/12 01:12:08 maya Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -1433,7 +1433,7 @@
 
        const u_int reset_id = be32dec(data);
 
-       if (reset_id > __arraycount(tegra124_car_reset_regs) * 32)
+       if (reset_id >= __arraycount(tegra124_car_reset_regs) * 32)
                return NULL;
 
        const u_int reg = reset_id / 32;



Home | Main Index | Thread Index | Old Index