From: Liu Ying Date: Mon, 30 Nov 2015 02:18:58 +0000 (+0800) Subject: MLK-11918-1 video: fbdev: mxc ipuv3 fb: Remove fbi NULL pointer check in ->remove() X-Git-Tag: C0P2-H0.0--20200415~3998 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=5b5bfbf5669079010b8802efa984bda609b6252b;p=linux.git MLK-11918-1 video: fbdev: mxc ipuv3 fb: Remove fbi NULL pointer check in ->remove() 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 --- diff --git a/drivers/video/fbdev/mxc/mxc_ipuv3_fb.c b/drivers/video/fbdev/mxc/mxc_ipuv3_fb.c index eb9b2f24842d..9f71693685b5 100644 --- a/drivers/video/fbdev/mxc/mxc_ipuv3_fb.c +++ b/drivers/video/fbdev/mxc/mxc_ipuv3_fb.c @@ -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);