MLK-12218 video: mxsfb: fix a potential unitialized pointer dereference
authorFancy Fang <chen.fang@nxp.com>
Tue, 12 Jan 2016 10:08:09 +0000 (18:08 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:46 +0000 (14:49 -0500)
The 'rgb' pointer may be dereferenced before being initialized.
So correct this.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
drivers/video/fbdev/mxsfb.c

index 7dea1ee..f9832e5 100644 (file)
@@ -465,7 +465,7 @@ static int mxsfb_check_var(struct fb_var_screeninfo *var,
                switch (host->ld_intf_width) {
                case STMLCDIF_8BIT:
                        pr_debug("Unsupported LCD bus width mapping\n");
-                       break;
+                       return -EINVAL;
                case STMLCDIF_16BIT:
                        /* 24 bit to 18 bit mapping */
                        rgb = def_rgb666;