From: Jiasheng Jiang Date: Mon, 20 Dec 2021 08:11:32 +0000 (+0800) Subject: video: fbdev: imxfb: Check for null res pointer X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9d54c5d47406588f7bae9b72bd9f922b33434327;p=linux.git 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 Signed-off-by: Helge Deller --- diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c index ad598257ab386..68288756ffff3 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);