diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-05-13 11:22:44 +0200 |
---|---|---|
committer | Zhenyu Wang <zhenyuw@linux.intel.com> | 2019-05-21 04:58:16 +0200 |
commit | 591c39ffac4ab1ddf2ea6d49331cb614e0682b28 (patch) | |
tree | 797f837a903efdf07d5295e13018502f58c12c50 /drivers/gpu/drm/i915 | |
parent | drm/i915/gvt: do not let TRTTE and 0x4dfc write passthrough to hardware (diff) | |
download | linux-591c39ffac4ab1ddf2ea6d49331cb614e0682b28.tar.xz linux-591c39ffac4ab1ddf2ea6d49331cb614e0682b28.zip |
drm/i915/gvt: Fix an error code in ppgtt_populate_spt_by_guest_entry()
"ret" is uninitialized on this path but it should be -EINVAL.
Fixes: 930c8dfea4b8 ("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>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/gvt/gtt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c index 08c74e65836b..244ad1729764 100644 --- a/drivers/gpu/drm/i915/gvt/gtt.c +++ b/drivers/gpu/drm/i915/gvt/gtt.c @@ -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)) { |