Re: [PATCH v1 2/3] interconnect: qcom: Add CAMNOC interconnect provider driver

[email protected]
Newsgroups org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing return value check for `icc_link_nodes()`.
--

--- Patch [2]: [PATCH v1 2/3] interconnect: qcom: Add CAMNOC interconnect provider driver ---
commit 210368acb417d0d403f4fd95176e70d2684711b8
Author: Atanas Filipov <[email protected]>
interconnect: qcom: Add CAMNOC interconnect provider driver

This commit introduces a new interconnect provider driver for the Qualcomm
Camera NOC (CAMNOC). It aggregates bandwidth requests from camera
sub-devices and adjusts the CAMNOC AXI clock rate to prevent a
last-writer-wins race condition.

> diff --git a/drivers/interconnect/qcom/qcom-camnoc.c b/drivers/interconnect/qcom/qcom-camnoc.c
> new file mode 100644
> index 0000000000000..a5a4844915153
> --- /dev/null
> +++ b/drivers/interconnect/qcom/qcom-camnoc.c

[ ... ]

> +static int qcom_camnoc_probe(struct platform_device *pdev)
> +{

[ ... ]

> +	for (i = 0; i < CAMNOC_NUM_NODES; i++) {
> +		node = icc_node_create_dyn();
> +		if (IS_ERR(node)) {
> +			ret = PTR_ERR(node);
> +			goto err_remove;
> +		}
> +
> +		ret = icc_node_set_name(node, provider, camnoc_nodes[i]->name);
> +		if (ret) {
> +			icc_node_destroy(node->id);
> +			goto err_remove;
> +		}
> +
> +		node->data = (void *)camnoc_nodes[i];
> +		icc_node_add(node, provider);
> +		data->nodes[i] = node;
> +	}
> +
> +	icc_link_nodes(data->nodes[MASTER_CAMNOC_JPEG],
> +		       &data->nodes[SLAVE_CAMNOC_AXI]);
> +
> +	ret = icc_provider_register(provider);

[Severity: High]
Does this code need to check the return value of icc_link_nodes?

If the internal memory allocation in icc_link_nodes fails, it returns an
error code (such as -ENOMEM) and the interconnect link is not created.

Because the error is ignored, the driver will continue and register the
provider successfully despite being broken. Later, when consumers request a
path through this interconnect, the path lookup will fail with -ENOENT,
potentially causing consumer drivers to malfunction or fail to probe.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.