MLK-11918-2 video: mxc ipuv3 fb: Return err in ->fb_check_var if fbi_tmp is NULL
authorLiu Ying <Ying.Liu@freescale.com>
Mon, 30 Nov 2015 02:55:12 +0000 (10:55 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:19 +0000 (14:49 -0500)
commit640ec10dd853d43d4617b0eea07c2140be8833de
treead82f0eb78fb37597f21ca64805f60d40131e786
parent5b5bfbf5669079010b8802efa984bda609b6252b
MLK-11918-2 video: mxc ipuv3 fb: Return err in ->fb_check_var if fbi_tmp is NULL

It has to be successful to find a relevant background framebuffer for a
foreground framebuffer.  So, we should return error code if it happens
to fail.

This patch fixes the following issue reported by Coverity:
Dereference after null check (FORWARD_NULL)
var_deref_op: Dereferencing null pointer fbi_tmp.
if (fbi_tmp->var.vmode & FB_VMODE_INTERLACED)
var->vmode |= FB_VMODE_INTERLACED;
else
var->vmode &= ~FB_VMODE_INTERLACED;

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
drivers/video/fbdev/mxc/mxc_ipuv3_fb.c