i2c: qup: release the DMA channels if getting the interconnect path fails
Subsystems (2)
PATCH 1/1 i2c: qup: release the DMA channels if getting the interconnect path fails
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 <[email protected]>
--- drivers/i2c/busses/i2c-qup.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/i2c/busses/i2c-qup.c +5 -3
@@ -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:
Signature · 1 line
2.25.1