MLK-11918-1 video: fbdev: mxc ipuv3 fb: Remove fbi NULL pointer check in ->remove()
authorLiu Ying <Ying.Liu@freescale.com>
Mon, 30 Nov 2015 02:18:58 +0000 (10:18 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:19 +0000 (14:49 -0500)
The driver takes the pointer fbi as the driver data, so fbi cannot be a NULL
pointer in ->remove().  Let's remove the unnecessary NULL pointer check on
fbi.

This patch fixes the following issue reported by Coverity:
deref_ptr: Directly dereferencing pointer fbi.
struct mxcfb_info *mxc_fbi = fbi->par;

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking fbi suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
if (!fbi)
return 0;

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

index eb9b2f2..9f71693 100644 (file)
@@ -3591,9 +3591,6 @@ static int mxcfb_remove(struct platform_device *pdev)
        struct fb_info *fbi = platform_get_drvdata(pdev);
        struct mxcfb_info *mxc_fbi = fbi->par;
 
-       if (!fbi)
-               return 0;
-
        device_remove_file(fbi->dev, &dev_attr_fsl_disp_dev_property);
        device_remove_file(fbi->dev, &dev_attr_fsl_disp_property);
        mxcfb_blank(FB_BLANK_POWERDOWN, fbi);