summaryrefslogtreecommitdiff
path: root/drivers/video/pmag-ba-fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/pmag-ba-fb.c')
-rw-r--r--drivers/video/pmag-ba-fb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c
index 0573ec685a57..0f361b6100d2 100644
--- a/drivers/video/pmag-ba-fb.c
+++ b/drivers/video/pmag-ba-fb.c
@@ -98,7 +98,8 @@ static int pmagbafb_setcolreg(unsigned int regno, unsigned int red,
{
struct pmagbafb_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 */