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
This commit is contained in:
Yeshwanth Sriram Guntuka 2021-06-23 09:32:00 +05:30 • committed by Madan Koyyalamudi
commit 9599a65f8b

View file

@ -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) {