[PATCH] i2c: qup: release the DMA channels if getting the interconnect path fails

From: Cong Nguyen

Date: Wed Nov 25 2026 - 08:43:33 EST


On QUP v2 controllers, qup_i2c_probe() requests the tx and rx DMA
channels with qup_i2c_req_dma(), then gets the interconnect path. If
devm_of_icc_get() fails, for example with -EPROBE_DEFER, probe returns
directly. The channels are not devm managed, so they are never
released and stay held after probe has failed.

Every other failure after the channels are requested goes to fail_dma,
which releases them. Do the same here.

Fixes: d4f35233a634 ("i2c: qup: Vote for interconnect bandwidth to DRAM")
Signed-off-by: Cong Nguyen <congnt264@xxxxxxxxx>
---
drivers/i2c/busses/i2c-qup.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 731bce9f9a92..53e74de5244b 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -1784,9 +1784,11 @@ static int qup_i2c_probe(struct platform_device *pdev)
qup->is_dma = true;

qup->icc_path = devm_of_icc_get(&pdev->dev, NULL);
- if (IS_ERR(qup->icc_path))
- return dev_err_probe(&pdev->dev, PTR_ERR(qup->icc_path),
- "failed to get interconnect path\n");
+ if (IS_ERR(qup->icc_path)) {
+ ret = dev_err_probe(&pdev->dev, PTR_ERR(qup->icc_path),
+ "failed to get interconnect path\n");
+ goto fail_dma;
+ }
}

nodma:
--
2.25.1