]> www.infradead.org Git - users/jedix/linux-maple.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)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Sat, 29 Jun 2024 10:20:05 +0000 (12:20 +0200)
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>
drivers/media/platform/qcom/camss/camss.c

index 1f1f44f6fbb2b49a02d8799dc7ab511665c2fe3e..51b1d3550421a424126351a065054099498b9af2 100644 (file)
@@ -1695,8 +1695,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;