git.samba.org
/
sfrench
/
cifs-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
drm/i915/gvt: Check if get_next_pt_type() always returns a valid value
[sfrench/cifs-2.6.git]
/
drivers
/
gpu
/
drm
/
i915
/
gvt
/
gtt.c
diff --git
a/drivers/gpu/drm/i915/gvt/gtt.c
b/drivers/gpu/drm/i915/gvt/gtt.c
index 7600416db90822864fc310a048511bcf2b438bc5..08c74e65836b52aab7f82d80ca7b37d98f202a74 100644
(file)
--- a/
drivers/gpu/drm/i915/gvt/gtt.c
+++ b/
drivers/gpu/drm/i915/gvt/gtt.c
@@
-1076,6
+1076,9
@@
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))
+ goto err;
+
spt = ppgtt_alloc_spt_gfn(vgpu, type, ops->get_pfn(we), ips);
if (IS_ERR(spt)) {
ret = PTR_ERR(spt);