MLK-12217 video: mxsfb: fix an uninitialized variable usage
authorFancy Fang <chen.fang@nxp.com>
Tue, 12 Jan 2016 10:03:39 +0000 (18:03 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:46 +0000 (14:49 -0500)
The 'vmode' variable is used before it is initialized.
So initialize it before that.

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

index d8c6885..7dea1ee 100644 (file)
@@ -1024,6 +1024,8 @@ static int mxsfb_restore_mode(struct mxsfb_info *host)
        if (!(ctrl & CTRL_RUN))
                return -EINVAL;
 
+       memset(&vmode, 0, sizeof(vmode));
+
        vdctrl0 = readl(host->base + LCDC_VDCTRL0);
        vdctrl2 = readl(host->base + LCDC_VDCTRL2);
        vdctrl3 = readl(host->base + LCDC_VDCTRL3);