Module Name:    src
Committed By:   christos
Date:           Sun Jan 21 04:20:10 UTC 2018

Modified Files:
        src/sys/dev/wsfb: genfb.c

Log Message:
CID-1427771: Remove incorrect pre-condition (index cannot be 256!)


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/wsfb/genfb.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/wsfb/genfb.c
diff -u src/sys/dev/wsfb/genfb.c:1.61 src/sys/dev/wsfb/genfb.c:1.62
--- src/sys/dev/wsfb/genfb.c:1.61	Wed May 31 22:45:12 2017
+++ src/sys/dev/wsfb/genfb.c	Sat Jan 20 23:20:10 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfb.c,v 1.61 2017/06/01 02:45:12 chs Exp $ */
+/*	$NetBSD: genfb.c,v 1.62 2018/01/21 04:20:10 christos Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.61 2017/06/01 02:45:12 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.62 2018/01/21 04:20:10 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -611,8 +611,7 @@ genfb_putcmap(struct genfb_softc *sc, st
 #ifdef GENFB_DEBUG
 	aprint_debug("putcmap: %d %d\n",index, count);
 #endif
-	if (cm->index >= 256 || cm->count > 256 ||
-	    (cm->index + cm->count) > 256)
+	if (index + count > 256)
 		return EINVAL;
 	error = copyin(cm->red, &rbuf[index], count);
 	if (error)

Reply via email to