Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / drivers / video / pmag-ba-fb.c
index 0573ec685a57ebc73156a2d4dcab8f3e177f9ae8..0f361b6100d2b6dc671c1ff1297718e2e47735fc 100644 (file)
@@ -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 */