MLK-11918-4 video: mxc ipuv3 fb: Fix dangling pointer dereference in check_var
authorLiu Ying <Ying.Liu@freescale.com>
Mon, 30 Nov 2015 03:46:00 +0000 (11:46 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:20 +0000 (14:49 -0500)
commit939b2d3ce8c816a48f39b413bb246a233c82047c
tree56f72d3fafd5d4cd15e93461bc10ba982c1f102c
parent552a9f971966c1384939be2270d3674fe2472dec
MLK-11918-4 video: mxc ipuv3 fb: Fix dangling pointer dereference in check_var

The function fbi_to_pixfmt() could access the pointer fbi->device provided
by it's input parameter fbi, so let's make sure the pointer isn't dangling.

This patch fixes the following issue reported by Coverity:
Uninitialized pointer read (UNINIT)
uninit_use_in_call: Using uninitialized value tmp_fbi.device when calling
fbi_to_pixfmt.
switch (fbi_to_pixfmt(&tmp_fbi, true)) {
case IPU_PIX_FMT_YUV420P2:
case IPU_PIX_FMT_YVU420P:

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