drm/i915/gvt: fix use after free for workload
In the function workload_thread(), we invoke complete_current_workload() to cleanup the just processed workload (workload will be freed there). So we cannot access workload->req after that. This patch move complete_current_workload() afterward. Signed-off-by: Changbin Du <changbin.du@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
This commit is contained in:
Родитель
2fcdb66364
Коммит
2e51ef32b0
|
@ -459,11 +459,11 @@ complete:
|
||||||
gvt_dbg_sched("will complete workload %p\n, status: %d\n",
|
gvt_dbg_sched("will complete workload %p\n, status: %d\n",
|
||||||
workload, workload->status);
|
workload, workload->status);
|
||||||
|
|
||||||
complete_current_workload(gvt, ring_id);
|
|
||||||
|
|
||||||
if (workload->req)
|
if (workload->req)
|
||||||
i915_gem_request_put(fetch_and_zero(&workload->req));
|
i915_gem_request_put(fetch_and_zero(&workload->req));
|
||||||
|
|
||||||
|
complete_current_workload(gvt, ring_id);
|
||||||
|
|
||||||
if (need_force_wake)
|
if (need_force_wake)
|
||||||
intel_uncore_forcewake_put(gvt->dev_priv,
|
intel_uncore_forcewake_put(gvt->dev_priv,
|
||||||
FORCEWAKE_ALL);
|
FORCEWAKE_ALL);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче