Skip to content

Commit

Permalink
video: fbdev: imxfb: Check for null res pointer
Browse files Browse the repository at this point in the history
The return value of platform_get_resource() needs to be checked.
To avoid use of error pointer in case that there is no suitable resource.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Helge Deller <deller@gmx.de>
  • Loading branch information
Jiasheng Jiang authored and Helge Deller committed Jan 29, 2022
1 parent 0cd129d commit 9d54c5d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/video/fbdev/imxfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,8 @@ static int imxfb_remove(struct platform_device *pdev)
struct resource *res;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -EINVAL;

imxfb_disable_controller(fbi);

Expand Down

0 comments on commit 9d54c5d

Please sign in to comment.