From: Jiasheng Jiang <jiasheng@iscas.ac.cn>
To: s.hauer@pengutronix.de, kernel@pengutronix.de,
shawnguo@kernel.org, festevam@gmail.com, linux-imx@nxp.com
Cc: linux-fbdev@vger.kernel.org,
Jiasheng Jiang <jiasheng@iscas.ac.cn>,
dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] video: fbdev: Check for null res pointer
Date: Mon, 20 Dec 2021 14:34:18 +0800 [thread overview]
Message-ID: <20211220063418.793624-1-jiasheng@iscas.ac.cn> (raw)
The return value of platform_get_resource() needs to be checked.
To avoid use of error pointer in case of the failure of alloc.
Fixes: f7018c213502 ("video: move fbdev to drivers/video/fbdev")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
drivers/video/fbdev/imxfb.c | 2 ++
1 file changed, 2 insertions(+)
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);
--
2.25.1
reply other threads:[~2021-12-20 6:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211220063418.793624-1-jiasheng@iscas.ac.cn \
--to=jiasheng@iscas.ac.cn \
--cc=dri-devel@lists.freedesktop.org \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).