]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: qcom: camss: Add check for v4l2_fwnode_endpoint_parse
authorChen Ni <nichen@iscas.ac.cn>
Fri, 21 Jun 2024 01:35:22 +0000 (09:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:11:31 +0000 (11:11 +0200)
[ Upstream commit 4caf6d93d9f2c11d6441c64e1c549c445fa322ed ]

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@iscas.ac.cn>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/qcom/camss/camss.c

index c6df862c79e39b9cb7f6efd8b88c5150e66c47d7..8fa6750b5b421b321f30196264595c5437c95d21 100644 (file)
@@ -1038,8 +1038,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;