Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/tc Leaving overflow-sensitive code, very similar to ...



details:   https://anonhg.NetBSD.org/src/rev/87dfe860a891
branches:  trunk
changeset: 535454:87dfe860a891
user:      itohy <itohy%NetBSD.org@localhost>
date:      Mon Aug 19 13:05:42 2002 +0000

description:
Leaving overflow-sensitive code, very similar to what was fixed
in the previous changes to cfb.c / sfb.c / xcfb.c, would not be clever.
Just modify in the similar way.

diffstat:

 sys/dev/tc/cfb.c     |  6 +++---
 sys/dev/tc/sfb.c     |  6 +++---
 sys/dev/tc/sfbplus.c |  8 ++++----
 sys/dev/tc/stic.c    |  8 ++++----
 sys/dev/tc/tfb.c     |  8 ++++----
 sys/dev/tc/xcfb.c    |  6 +++---
 6 files changed, 21 insertions(+), 21 deletions(-)

diffs (189 lines):

diff -r 81005a432413 -r 87dfe860a891 sys/dev/tc/cfb.c
--- a/sys/dev/tc/cfb.c  Mon Aug 19 12:03:48 2002 +0000
+++ b/sys/dev/tc/cfb.c  Mon Aug 19 13:05:42 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cfb.c,v 1.35 2002/08/19 03:52:53 itohy Exp $ */
+/* $NetBSD: cfb.c,v 1.36 2002/08/19 13:05:42 itohy Exp $ */
 
 /*
  * Copyright (c) 1998, 1999 Tohru Nishimura.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.35 2002/08/19 03:52:53 itohy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.36 2002/08/19 13:05:42 itohy Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -694,7 +694,7 @@
 {
        u_int index = p->index, count = p->count;
 
-       if (index >= CMAP_SIZE || (index + count) > CMAP_SIZE)
+       if (index >= CMAP_SIZE || count > CMAP_SIZE - index)
                return (EINVAL);
 
        if (!uvm_useracc(p->red, count, B_READ) ||
diff -r 81005a432413 -r 87dfe860a891 sys/dev/tc/sfb.c
--- a/sys/dev/tc/sfb.c  Mon Aug 19 12:03:48 2002 +0000
+++ b/sys/dev/tc/sfb.c  Mon Aug 19 13:05:42 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sfb.c,v 1.54 2002/08/19 03:52:53 itohy Exp $ */
+/* $NetBSD: sfb.c,v 1.55 2002/08/19 13:05:43 itohy Exp $ */
 
 /*
  * Copyright (c) 1998, 1999 Tohru Nishimura.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sfb.c,v 1.54 2002/08/19 03:52:53 itohy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sfb.c,v 1.55 2002/08/19 13:05:43 itohy Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -724,7 +724,7 @@
 {
        u_int index = p->index, count = p->count;
 
-       if (index >= CMAP_SIZE || (index + count) > CMAP_SIZE)
+       if (index >= CMAP_SIZE || count > CMAP_SIZE - index)
                return (EINVAL);
 
        if (!uvm_useracc(p->red, count, B_READ) ||
diff -r 81005a432413 -r 87dfe860a891 sys/dev/tc/sfbplus.c
--- a/sys/dev/tc/sfbplus.c      Mon Aug 19 12:03:48 2002 +0000
+++ b/sys/dev/tc/sfbplus.c      Mon Aug 19 13:05:42 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sfbplus.c,v 1.15 2002/07/04 14:37:13 junyoung Exp $ */
+/* $NetBSD: sfbplus.c,v 1.16 2002/08/19 13:05:43 itohy Exp $ */
 
 /*
  * Copyright (c) 1999, 2000, 2001 Tohru Nishimura.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sfbplus.c,v 1.15 2002/07/04 14:37:13 junyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sfbplus.c,v 1.16 2002/08/19 13:05:43 itohy Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -711,7 +711,7 @@
 {
        u_int index = p->index, count = p->count;
 
-       if (index >= CMAP_SIZE || (index + count) > CMAP_SIZE)
+       if (index >= CMAP_SIZE || count > CMAP_SIZE - index)
                return (EINVAL);
 
        if (!uvm_useracc(p->red, count, B_WRITE) ||
@@ -733,7 +733,7 @@
 {
        u_int index = p->index, count = p->count;
 
-       if (index >= CMAP_SIZE || (index + count) > CMAP_SIZE)
+       if (index >= CMAP_SIZE || count > CMAP_SIZE - index)
                return (EINVAL);
 
        if (!uvm_useracc(p->red, count, B_READ) ||
diff -r 81005a432413 -r 87dfe860a891 sys/dev/tc/stic.c
--- a/sys/dev/tc/stic.c Mon Aug 19 12:03:48 2002 +0000
+++ b/sys/dev/tc/stic.c Mon Aug 19 13:05:42 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stic.c,v 1.18 2002/07/04 14:37:13 junyoung Exp $       */
+/*     $NetBSD: stic.c,v 1.19 2002/08/19 13:05:44 itohy Exp $  */
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.18 2002/07/04 14:37:13 junyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.19 2002/08/19 13:05:44 itohy Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1257,7 +1257,7 @@
        index = p->index;
        count = p->count;
 
-       if (index >= CMAP_SIZE || (index + count) > CMAP_SIZE)
+       if (index >= CMAP_SIZE || count > CMAP_SIZE - index)
                return (EINVAL);
 
        if (!uvm_useracc(p->red, count, B_WRITE) ||
@@ -1280,7 +1280,7 @@
        index = p->index;
        count = p->count;
 
-       if ((index + count) > CMAP_SIZE)
+       if (index >= CMAP_SIZE || count > CMAP_SIZE - index)
                return (EINVAL);
 
        if (!uvm_useracc(p->red, count, B_READ) ||
diff -r 81005a432413 -r 87dfe860a891 sys/dev/tc/tfb.c
--- a/sys/dev/tc/tfb.c  Mon Aug 19 12:03:48 2002 +0000
+++ b/sys/dev/tc/tfb.c  Mon Aug 19 13:05:42 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tfb.c,v 1.35 2002/07/04 14:37:14 junyoung Exp $ */
+/* $NetBSD: tfb.c,v 1.36 2002/08/19 13:05:44 itohy Exp $ */
 
 /*
  * Copyright (c) 1998, 1999 Tohru Nishimura.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tfb.c,v 1.35 2002/07/04 14:37:14 junyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tfb.c,v 1.36 2002/08/19 13:05:44 itohy Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -752,7 +752,7 @@
 {
        u_int index = p->index, count = p->count;
 
-       if (index >= CMAP_SIZE || (index + count) > CMAP_SIZE)
+       if (index >= CMAP_SIZE || count > CMAP_SIZE - index)
                return (EINVAL);
 
        if (!uvm_useracc(p->red, count, B_WRITE) ||
@@ -774,7 +774,7 @@
 {
        u_int index = p->index, count = p->count;
 
-       if (index >= CMAP_SIZE || (index + count) > CMAP_SIZE)
+       if (index >= CMAP_SIZE || count > CMAP_SIZE - index)
                return (EINVAL);
 
        if (!uvm_useracc(p->red, count, B_READ) ||
diff -r 81005a432413 -r 87dfe860a891 sys/dev/tc/xcfb.c
--- a/sys/dev/tc/xcfb.c Mon Aug 19 12:03:48 2002 +0000
+++ b/sys/dev/tc/xcfb.c Mon Aug 19 13:05:42 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xcfb.c,v 1.29 2002/08/06 22:52:53 itojun Exp $ */
+/* $NetBSD: xcfb.c,v 1.30 2002/08/19 13:05:45 itohy Exp $ */
 
 /*
  * Copyright (c) 1998, 1999 Tohru Nishimura.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xcfb.c,v 1.29 2002/08/06 22:52:53 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xcfb.c,v 1.30 2002/08/19 13:05:45 itohy Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -575,7 +575,7 @@
 {
        u_int index = p->index, count = p->count;
 
-       if (index >= CMAP_SIZE || (index + count) > CMAP_SIZE)
+       if (index >= CMAP_SIZE || count > CMAP_SIZE - index)
                return (EINVAL);
 
        if (!uvm_useracc(p->red, count, B_READ) ||



Home | Main Index | Thread Index | Old Index