Browse Source

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
Yeshwanth Sriram Guntuka 4 years ago
parent
commit
f5e4766465
1 changed files with 1 additions and 1 deletions
  1. 1 1
      hif/src/hif_runtime_pm.c

+ 1 - 1
hif/src/hif_runtime_pm.c

@@ -1222,7 +1222,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) {