[PATCH 4/6] drm/i915/gvt: Refine error handling for intel_vgpu_pin_mm
fred gao
fred.gao at intel.com
Mon Aug 7 04:13:21 UTC 2017
When it is failed in shadow_mm, the pin_count should rollback
to the original states before return.
v2:
- split the mixed several error paths for better review. (Zhenyu)
Signed-off-by: fred gao <fred.gao at intel.com>
---
drivers/gpu/drm/i915/gvt/gtt.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c
index 66374db..8f46019 100644
--- a/drivers/gpu/drm/i915/gvt/gtt.c
+++ b/drivers/gpu/drm/i915/gvt/gtt.c
@@ -1630,8 +1630,10 @@ int intel_vgpu_pin_mm(struct intel_vgpu_mm *mm)
if (!mm->shadowed) {
ret = shadow_mm(mm);
- if (ret)
+ if (ret) {
+ atomic_dec(&mm->pincount);
return ret;
+ }
}
list_del_init(&mm->lru_list);
--
2.7.4
More information about the intel-gvt-dev
mailing list