OSDN Git Service

i915: cast before shifting in i915_pte_count
authorAlan <gnomes@lxorguk.ukuu.org.uk>
Wed, 17 Feb 2016 14:20:46 +0000 (14:20 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 17 Feb 2016 16:00:38 +0000 (17:00 +0100)
commit69603dbb315fc7a2b855990ee308b97dc23bf6eb
tree4cf8a1d1130924f4f901a39ecbdb0b36f31f9a2a
parentecb2448218acf23c401434c26be256147833b221
i915: cast before shifting in i915_pte_count

Otherwise a pde_shift big enough to overflow a u32 will be truncated before
assignment

Note: We never asked for ranges spanning a 4G boundary, so this issue
doesn't cause a real problem.

Signed-off-by: Alan Cox <alan@linux.intel.com>
[danvet: Add note why this isn't a real problem.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20160217142043.4947.60447.stgit@localhost.localdomain
drivers/gpu/drm/i915/i915_gem_gtt.h