提交 fdc454c1 编写于 作者: M Michel Thierry 提交者: Daniel Vetter

drm/i915: Prevent out of range pt in gen6_for_each_pde

Found by static analysis tool, this was harmless as the pt was not
used out of scope though.

Introduced by commit 678d96fb
("drm/i915: Track GEN6 page table usage").

Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 2c60fae1
......@@ -339,9 +339,9 @@ struct i915_hw_ppgtt {
* XXX: temp is not actually needed, but it saves doing the ALIGN operation.
*/
#define gen6_for_each_pde(pt, pd, start, length, temp, iter) \
for (iter = gen6_pde_index(start), pt = (pd)->page_table[iter]; \
length > 0 && iter < I915_PDES; \
pt = (pd)->page_table[++iter], \
for (iter = gen6_pde_index(start); \
pt = (pd)->page_table[iter], length > 0 && iter < I915_PDES; \
iter++, \
temp = ALIGN(start+1, 1 << GEN6_PDE_SHIFT) - start, \
temp = min_t(unsigned, temp, length), \
start += temp, length -= temp)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册