On 1/30/2025 1:28 PM, Krzysztof Kozlowski wrote: > On 30/01/2025 05:35, Raj Kumar Bhagat wrote: >> + >> +static void ath12k_ahb_unregister_rproc_notifier(struct ath12k_base *ab) >> +{ >> + struct ath12k_ahb *ab_ahb = ath12k_ab_to_ahb(ab); >> + >> + if (!ab_ahb->root_pd_notifier) { >> + ath12k_err(ab, "Rproc notifier not registered\n"); >> + return; >> + } >> + >> + qcom_unregister_ssr_notifier(ab_ahb->root_pd_notifier, >> + &ab_ahb->root_pd_nb); >> + ab_ahb->root_pd_notifier = NULL; >> +} >> + >> +static int ath12k_ahb_get_rproc(struct ath12k_base *ab) >> +{ >> + struct ath12k_ahb *ab_ahb = ath12k_ab_to_ahb(ab); >> + struct device *dev = ab->dev; >> + struct device_node *np; >> + struct rproc *prproc; >> + >> + np = of_parse_phandle(dev->of_node, "qcom,rproc", 0); >> + if (!np) { >> + ath12k_err(ab, "failed to get q6_rproc handle\n"); >> + return -ENOENT; >> + } >> + >> + prproc = rproc_get_by_phandle(np->phandle); >> + if (!prproc) > > Nothing improved here - you still leak the reference. > Thanks, will take care of np refcount leak in next version. >> + return dev_err_probe(&ab->pdev->dev, -EPROBE_DEFER, >> + "failed to get rproc\n"); >> + >> + ab_ahb->tgt_rproc = prproc; > > And here. > Thanks, will handle rproc refcount leak.