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>
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);