Skip to content
Commit 27348cc9 authored by Aleksei Gimbitskii's avatar Aleksei Gimbitskii Committed by Zhenyu Wang
Browse files

drm/i915/gvt: Check if cur_pt_type is valid



Static code analyzer warns that index value for scratch_pt may be equal
to -1. Index value type is intel_gvt_gtt_type_t, so it may be any number
at range -1 to 17. Check first if cur_pt_type and cur_pt_type+1 is valid
values.

v2:
 - Print some error messages if page table type is invalid. (Colin Xu)

v4:
 - Print cur_pt_type in error message. (Colin Xu)

This patch fixed the critial issue #422 reported by klocwork.

Acked-by: default avatarColin Xu <colin.xu@intel.com>
Signed-off-by: default avatarAleksei Gimbitskii <aleksei.gimbitskii@intel.com>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Zhi Wang <zhi.a.wang@intel.com>
Cc: Colin Xu <colin.xu@intel.com>
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
parent 3035e8cd
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment