From 9599a65f8baea01d21e6377abeb4151d8e824e2a Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Wed, 23 Jun 2021 09:32:00 +0530 Subject: [PATCH] qcacmn: Modify ret variable check in hif_pm_runtime_get Runtime put should be done in hif_pm_runtime_get when return value of __hif_pm_runtime_get is negative. In the issue scenario, the ret value will be set to 0 when the return value of __hif_pm_runtime_get is positive. The store operation for ret variable somehow did not take effect and the if check for non-zero ret value to do runtime put did go through. The return value to dp_tx_hw_enqueue from hif_pm_runtime_get is the updated ret value of 0. This will result in double runtime put for a single runtime get. Fix is to modify the ret variable check to negative instead of non-zero to ensure runtime put happens correctly. Change-Id: Idc380a11c82b6d1acf7c750e7b93776ac9d6b4f2 CRs-Fixed: 2969879 --- hif/src/hif_runtime_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hif/src/hif_runtime_pm.c b/hif/src/hif_runtime_pm.c index e22f44ff2079..061558aca878 100644 --- a/hif/src/hif_runtime_pm.c +++ b/hif/src/hif_runtime_pm.c @@ -1217,7 +1217,7 @@ int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx, if (ret > 0) ret = 0; - if (ret) + if (ret < 0) hif_pm_runtime_put(hif_ctx, rtpm_dbgid); if (ret && ret != -EINPROGRESS) {