diff options
author | 2009-12-15 16:46:25 -0800 | |
---|---|---|
committer | 2009-12-16 07:20:01 -0800 | |
commit | 2f390380ca69e1617cdddb12d8da94f0a9f4319d (patch) | |
tree | 2f60b69e62e099c43a90197c62704f099ad2169e /drivers/video/pmagb-b-fb.c | |
parent | fbdev: drop custom atoi from drivers/video/modedb.c (diff) | |
download | linux-2f390380ca69e1617cdddb12d8da94f0a9f4319d.tar.gz linux-2f390380ca69e1617cdddb12d8da94f0a9f4319d.tar.bz2 linux-2f390380ca69e1617cdddb12d8da94f0a9f4319d.zip |
fbdev: add palette register check to several drivers
Add check if palette register number is in correct range for few drivers
which miss it. The regno value comes indirectly from user space.
Two drivers has converted check from BUG_ON() macro to just return an
error (non-zero value).
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/pmagb-b-fb.c')
-rw-r--r-- | drivers/video/pmagb-b-fb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c index 98748723af9f..2de0806421b4 100644 --- a/drivers/video/pmagb-b-fb.c +++ b/drivers/video/pmagb-b-fb.c @@ -102,7 +102,8 @@ static int pmagbbfb_setcolreg(unsigned int regno, unsigned int red, { struct pmagbbfb_par *par = info->par; - BUG_ON(regno >= info->cmap.len); + if (regno >= info->cmap.len) + return 1; red >>= 8; /* The cmap fields are 16 bits */ green >>= 8; /* wide, but the hardware colormap */ |