drm/i915/gvt: Avoid use-after-free iterating the gtt list
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 20 Nov 2018 20:24:38 +0000 (20:24 +0000)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Wed, 21 Nov 2018 09:31:56 +0000 (17:31 +0800)
commit7513edbc096a006f967eaf39088091442e623b83
tree71b5cb3bbd66642d967cfc6730467246aa45ba5e
parentf3be657d96b0709c832b165501170f072882df3c
drm/i915/gvt: Avoid use-after-free iterating the gtt list

Found by smatch:

drivers/gpu/drm/i915/gvt/gtt.c:2452 intel_vgpu_destroy_ggtt_mm() error: dereferencing freed memory 'pos'

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/gtt.c