Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 215eaf8b authored by Sahitya Tummala's avatar Sahitya Tummala Committed by Gerrit - the friendly Code Review server
Browse files

mmc: cmdq_hci: Fix key index refcnt issue with metadata encryption



When metadata encryption is enabled, below errors are observed
from pfk driver.

[   44.754642] internal error, ref count should never be negative index 2

For discard commands, cq_host->ops->crypto_cfg_end() is being invoked
without its corresponding cq_host->ops->crypto_cfg() call. This is fine
until now, because ICE driver's  msm_host->ice.vops->config_end() would
do nothing if req->bio is NULL. But with metadata encryption this may
not be NULL, thus resulting into refcnt mismatch for that key.

Change-Id: I1609eb8506d0d19944c536adbd9253da2a45c47c
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
parent a487c3ab
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -888,6 +888,7 @@ static void cmdq_finish_data(struct mmc_host *mmc, unsigned int tag)

	cmdq_runtime_pm_put(cq_host);

	if (!(mrq->cmdq_req->cmdq_req_flags & DCMD)) {
		if (cq_host->ops->crypto_cfg_end) {
			err = cq_host->ops->crypto_cfg_end(mmc, mrq);
			if (err) {
@@ -895,6 +896,7 @@ static void cmdq_finish_data(struct mmc_host *mmc, unsigned int tag)
						mmc_hostname(mmc), err, tag);
			}
		}
	}
	if (!(cq_host->caps & CMDQ_CAP_CRYPTO_SUPPORT) &&
			cq_host->ops->crypto_cfg_reset)
		cq_host->ops->crypto_cfg_reset(mmc, tag);