From: Akhil P Oommen Date: Tue, 22 Sep 2020 14:55:27 +0000 (+0530) Subject: drm/msm: Leave inuse count intact on map failure X-Git-Tag: v5.10-rc1~123^2~8^2~3 X-Git-Url: https://repo.jachan.dev/linux.git/commitdiff_plain/63ca94adc03cff509d20b1306e48afccb44d5bdf drm/msm: Leave inuse count intact on map failure Leave the inuse count intact on map failure to keep the accounting accurate. Signed-off-by: Akhil P Oommen Signed-off-by: Rob Clark --- diff --git a/drivers/gpu/drm/msm/msm_gem_vma.c b/drivers/gpu/drm/msm/msm_gem_vma.c index 80a8a266d68f..f914ddbaea89 100644 --- a/drivers/gpu/drm/msm/msm_gem_vma.c +++ b/drivers/gpu/drm/msm/msm_gem_vma.c @@ -88,8 +88,10 @@ msm_gem_map_vma(struct msm_gem_address_space *aspace, ret = aspace->mmu->funcs->map(aspace->mmu, vma->iova, sgt, size, prot); - if (ret) + if (ret) { vma->mapped = false; + vma->inuse--; + } return ret; }