diff options
Diffstat (limited to 'drivers/video/sis/sis_main.c')
-rw-r--r-- | drivers/video/sis/sis_main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c index 93d07ef85276..e8ccace01252 100644 --- a/drivers/video/sis/sis_main.c +++ b/drivers/video/sis/sis_main.c | |||
@@ -1405,12 +1405,18 @@ sisfb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, | |||
1405 | } | 1405 | } |
1406 | break; | 1406 | break; |
1407 | case 16: | 1407 | case 16: |
1408 | if (regno >= 16) | ||
1409 | break; | ||
1410 | |||
1408 | ((u32 *)(info->pseudo_palette))[regno] = | 1411 | ((u32 *)(info->pseudo_palette))[regno] = |
1409 | (red & 0xf800) | | 1412 | (red & 0xf800) | |
1410 | ((green & 0xfc00) >> 5) | | 1413 | ((green & 0xfc00) >> 5) | |
1411 | ((blue & 0xf800) >> 11); | 1414 | ((blue & 0xf800) >> 11); |
1412 | break; | 1415 | break; |
1413 | case 32: | 1416 | case 32: |
1417 | if (regno >= 16) | ||
1418 | break; | ||
1419 | |||
1414 | red >>= 8; | 1420 | red >>= 8; |
1415 | green >>= 8; | 1421 | green >>= 8; |
1416 | blue >>= 8; | 1422 | blue >>= 8; |