qcom_q6v5_init() acquires the QMP handle before getting the
interconnect path. If devm_of_icc_get() fails, the function
returns without releasing the QMP handle, leaking the device
reference acquired by qmp_get().
Release the QMP handle on the interconnect error path before returning.
Fixes: 8d9be5c6bdcd ("remoteproc: qcom: q6v5: Add interconnect path proxy vote")
Signed-off-by: Haoxiang Li <[email protected]>
---
drivers/remoteproc/qcom_q6v5.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/remoteproc/qcom_q6v5.c b/drivers/remoteproc/qcom_q6v5.c
index 58d5b85e58cd..b57041a37d28 100644
--- a/drivers/remoteproc/qcom_q6v5.c
+++ b/drivers/remoteproc/qcom_q6v5.c
@@ -347,9 +347,11 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct
platform_device *pdev,
}
q6v5->path = devm_of_icc_get(&pdev->dev, NULL);
- if (IS_ERR(q6v5->path))
+ if (IS_ERR(q6v5->path)) {
+ qmp_put(q6v5->qmp);
return dev_err_probe(&pdev->dev, PTR_ERR(q6v5->path),
"failed to acquire interconnect path\n");
+ }
return 0;
}
--
2.25.1