Skip to contentSkip to conversation

2.5.24 matroxfb off by one error

PATCH New Petr Vandrovec 1 participant 1 message Jun 29, 2002 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.5.24 matroxfb off by one error

Hi Linus,
please apply patch below.

It fixes off by one error in getcolreg/setcolreg in matroxfb's
secondary head driver.
Thanks,
Petr Vandrovec [email protected]

drivers/video/matrox/matroxfb_crtc2.c +2 -2
diff -urdN linux/drivers/video/matrox/matroxfb_crtc2.c linux/drivers/video/matrox/matroxfb_crtc2.c
@@ -29,7 +29,7 @@
 static int matroxfb_dh_getcolreg(unsigned regno, unsigned *red, unsigned *green,
 		unsigned *blue, unsigned *transp, struct fb_info* info) {
 #define m2info ((struct matroxfb_dh_fb_info*)info)
-	if (regno > 16)
+	if (regno >= 16)
 		return 1;
 	*red = m2info->palette[regno].red;
 	*blue = m2info->palette[regno].blue;
@@ -44,7 +44,7 @@
 #define m2info ((struct matroxfb_dh_fb_info*)info)
 	struct display* p;
 
-	if (regno > 16)
+	if (regno >= 16)
 		return 1;
 	m2info->palette[regno].red = red;
 	m2info->palette[regno].blue = blue;

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
No, I will not fix your computer.
http://thinkgeek.com/sf