[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20221016135200.3406628-1-mirela.rabulea@oss.nxp.com>
Date: Sun, 16 Oct 2022 16:52:00 +0300
From: Mirela Rabulea <mirela.rabulea@....nxp.com>
To: mchehab@...nel.org, shawnguo@...nel.org, s.hauer@...gutronix.de,
dan.carpenter@...cle.com, ming.qian@....com
Cc: linux-media@...r.kernel.org, linux-imx@....com,
kernel@...gutronix.de, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, festevam@...il.com
Subject: [PATCH] media: imx-jpeg: Fix Coverity issue in probe
Possible dereference null return after of_match_node,
so check for NULL of_id.
Signed-off-by: Mirela Rabulea <mirela.rabulea@....nxp.com>
---
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
index 51a503f0a47b..9d0a361a94cb 100644
--- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
+++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
@@ -2432,6 +2432,8 @@ static int mxc_jpeg_probe(struct platform_device *pdev)
unsigned int slot;
of_id = of_match_node(mxc_jpeg_match, dev->of_node);
+ if (!of_id)
+ return -ENODEV;
mode = *(const int *)of_id->data;
jpeg = devm_kzalloc(dev, sizeof(struct mxc_jpeg_dev), GFP_KERNEL);
--
2.25.1
Powered by blists - more mailing lists