lkml.org 
[lkml]   [2022]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] media: imx-jpeg: Fix Coverity issue in probe
Date
Possible dereference null return after of_match_node,
so check for NULL of_id.

Signed-off-by: Mirela Rabulea <mirela.rabulea@oss.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
\
 
 \ /
  Last update: 2022-10-16 15:53    [W:0.054 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site