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: 930c8dfea4
("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>
This commit is contained in:
parent
e175a2520c
commit
591c39ffac
|
@ -1076,8 +1076,10 @@ static struct intel_vgpu_ppgtt_spt *ppgtt_populate_spt_by_guest_entry(
|
||||||
} else {
|
} else {
|
||||||
int type = get_next_pt_type(we->type);
|
int type = get_next_pt_type(we->type);
|
||||||
|
|
||||||
if (!gtt_type_is_pt(type))
|
if (!gtt_type_is_pt(type)) {
|
||||||
|
ret = -EINVAL;
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
spt = ppgtt_alloc_spt_gfn(vgpu, type, ops->get_pfn(we), ips);
|
spt = ppgtt_alloc_spt_gfn(vgpu, type, ops->get_pfn(we), ips);
|
||||||
if (IS_ERR(spt)) {
|
if (IS_ERR(spt)) {
|
||||||
|
|
Loading…
Reference in New Issue