Skip to content

Commit

Permalink
drm/i915/gvt: Fix an error code in ppgtt_populate_spt_by_guest_entry()
Browse files Browse the repository at this point in the history
"ret" is uninitialized on this path but it should be -EINVAL.

Fixes: 930c8df ("drm/i915/gvt: Check if get_next_pt_type() always returns a valid value")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
  • Loading branch information
Dan Carpenter authored and Zhenyu Wang committed May 21, 2019
1 parent e175a25 commit 591c39f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/i915/gvt/gtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1076,8 +1076,10 @@ static struct intel_vgpu_ppgtt_spt *ppgtt_populate_spt_by_guest_entry(
} else {
int type = get_next_pt_type(we->type);

if (!gtt_type_is_pt(type))
if (!gtt_type_is_pt(type)) {
ret = -EINVAL;
goto err;
}

spt = ppgtt_alloc_spt_gfn(vgpu, type, ops->get_pfn(we), ips);
if (IS_ERR(spt)) {
Expand Down

0 comments on commit 591c39f

Please sign in to comment.