Skip to content

Commit fe80d32

Browse files
joehattoriandersson
authored andcommitted
remoteproc: qcom: adsp: Remove subdevs on the error path of adsp_probe()
Current implementation of adsp_probe() in qcom_q6v5_adsp.c and does not remove the subdevs of adsp on the error path. Fix this bug by calling qcom_remove_{ssr,sysmon,pdm,smd,glink}_subdev(), and qcom_q6v5_deinit() appropriately. Fixes: dc160e4 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver") Signed-off-by: Joe Hattori <[email protected]> Link: https://lore.kernel.org/r/fed3df4219543d46b88bacf87990d947f3fac8d7.1731038950.git.joe@pf.is.s.u-tokyo.ac.jp Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 587b67c commit fe80d32

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/remoteproc/qcom_q6v5_adsp.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,15 +734,22 @@ static int adsp_probe(struct platform_device *pdev)
734734
desc->ssctl_id);
735735
if (IS_ERR(adsp->sysmon)) {
736736
ret = PTR_ERR(adsp->sysmon);
737-
goto disable_pm;
737+
goto deinit_remove_glink_pdm_ssr;
738738
}
739739

740740
ret = rproc_add(rproc);
741741
if (ret)
742-
goto disable_pm;
742+
goto remove_sysmon;
743743

744744
return 0;
745745

746+
remove_sysmon:
747+
qcom_remove_sysmon_subdev(adsp->sysmon);
748+
deinit_remove_glink_pdm_ssr:
749+
qcom_q6v5_deinit(&adsp->q6v5);
750+
qcom_remove_glink_subdev(rproc, &adsp->glink_subdev);
751+
qcom_remove_pdm_subdev(rproc, &adsp->pdm_subdev);
752+
qcom_remove_ssr_subdev(rproc, &adsp->ssr_subdev);
746753
disable_pm:
747754
qcom_rproc_pds_detach(adsp);
748755

0 commit comments

Comments
 (0)