[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240621013522.1704762-1-nichen@iscas.ac.cn>
Date: Fri, 21 Jun 2024 09:35:22 +0800
From: Chen Ni <nichen@...as.ac.cn>
To: rfoss@...nel.org,
todor.too@...il.com,
bryan.odonoghue@...aro.org,
mchehab@...nel.org
Cc: linux-media@...r.kernel.org,
linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Chen Ni <nichen@...as.ac.cn>
Subject: [PATCH] media: qcom: camss: Add check for v4l2_fwnode_endpoint_parse
Add check for the return value of v4l2_fwnode_endpoint_parse() and
return the error if it fails in order to catch the error.
Signed-off-by: Chen Ni <nichen@...as.ac.cn>
---
drivers/media/platform/qcom/camss/camss.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 1923615f0eea..c90a28fa8891 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -1406,8 +1406,11 @@ static int camss_of_parse_endpoint_node(struct device *dev,
struct v4l2_mbus_config_mipi_csi2 *mipi_csi2;
struct v4l2_fwnode_endpoint vep = { { 0 } };
unsigned int i;
+ int ret;
- v4l2_fwnode_endpoint_parse(of_fwnode_handle(node), &vep);
+ ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(node), &vep);
+ if (ret)
+ return ret;
csd->interface.csiphy_id = vep.base.port;
--
2.25.1
Powered by blists - more mailing lists