Commit 485c916b authored by Petr Vandrovec's avatar Petr Vandrovec

[PATCH] 2.5.24 matroxfb off by one error

   This fixes an off by one error in getcolreg/setcolreg in matroxfb's
secondary head driver.
parent 623568bf
...@@ -29,7 +29,7 @@ MODULE_PARM_DESC(mem, "Memory size reserved for dualhead (default=8MB)"); ...@@ -29,7 +29,7 @@ MODULE_PARM_DESC(mem, "Memory size reserved for dualhead (default=8MB)");
static int matroxfb_dh_getcolreg(unsigned regno, unsigned *red, unsigned *green, static int matroxfb_dh_getcolreg(unsigned regno, unsigned *red, unsigned *green,
unsigned *blue, unsigned *transp, struct fb_info* info) { unsigned *blue, unsigned *transp, struct fb_info* info) {
#define m2info ((struct matroxfb_dh_fb_info*)info) #define m2info ((struct matroxfb_dh_fb_info*)info)
if (regno > 16) if (regno >= 16)
return 1; return 1;
*red = m2info->palette[regno].red; *red = m2info->palette[regno].red;
*blue = m2info->palette[regno].blue; *blue = m2info->palette[regno].blue;
...@@ -44,7 +44,7 @@ static int matroxfb_dh_setcolreg(unsigned regno, unsigned red, unsigned green, ...@@ -44,7 +44,7 @@ static int matroxfb_dh_setcolreg(unsigned regno, unsigned red, unsigned green,
#define m2info ((struct matroxfb_dh_fb_info*)info) #define m2info ((struct matroxfb_dh_fb_info*)info)
struct display* p; struct display* p;
if (regno > 16) if (regno >= 16)
return 1; return 1;
m2info->palette[regno].red = red; m2info->palette[regno].red = red;
m2info->palette[regno].blue = blue; m2info->palette[regno].blue = blue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment