diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2021-12-20 11:11:32 +0300 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2022-01-30 00:24:24 +0300 |
commit | 9d54c5d47406588f7bae9b72bd9f922b33434327 (patch) | |
tree | b8ba836ba65b9ad570ffcdbb25ca03d6994292bf /drivers/video/fbdev/imxfb.c | |
parent | 0cd129de3ee7be794ed1136fc0ea60f0e696d10e (diff) | |
download | linux-9d54c5d47406588f7bae9b72bd9f922b33434327.tar.xz |
video: fbdev: imxfb: Check for null res pointer
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>
Diffstat (limited to 'drivers/video/fbdev/imxfb.c')
-rw-r--r-- | drivers/video/fbdev/imxfb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c index ad598257ab38..68288756ffff 100644 --- a/drivers/video/fbdev/imxfb.c +++ b/drivers/video/fbdev/imxfb.c @@ -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); |