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

Commit f6a0a177 authored by Neha Atri's avatar Neha Atri
Browse files

iommu: Fix bug in __msm_map_iommu_common()



In error situations, iommu_meta remains NULL and msm_iommu_meta_put()
gets called with this NULL pointer. Fix this.

CRs-Fixed: 769233
Change-Id: I91c1e234c16d40af249a2d54faf6eae087281f5b
Signed-off-by: default avatarNeha Atri <natri@codeaurora.org>
parent 51c75088
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -428,6 +428,11 @@ static int __msm_map_iommu_common(

	if (!iommu_meta) {
		iommu_meta = msm_iommu_meta_create(dma_buf, table, size);

		if (IS_ERR(iommu_meta)) {
			ret = PTR_ERR(iommu_meta);
			goto out;
		}
	} else {
		/*
		 * Drop the dma_buf reference here. We took the reference
@@ -479,7 +484,7 @@ static int __msm_map_iommu_common(
out_unlock:
	mutex_unlock(&iommu_meta->lock);
out:

	if (iommu_meta)
		msm_iommu_meta_put(iommu_meta);
	return ret;