]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Limit the for_each_set_bit() to the valid range
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 16 Jan 2019 15:54:21 +0000 (15:54 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 17 Jan 2019 21:10:52 +0000 (21:10 +0000)
commit7f1a0c471b1075aa45bc0bf89751fe73727fa2fb
treedc25a4080d33c950bc11fa53636673a27eb58002
parent363f303fbc81dea35e029ec19f24c02f0ed07094
drm/i915: Limit the for_each_set_bit() to the valid range

Let static analyzers (smatch) know that we are not going to wander off
the end of the array by providing a tight upper bound:

drivers/gpu/drm/i915/intel_display.c:9532 hsw_get_transcoder_state() error: buffer overflow 'dev_priv->__info.trans_offsets' 6 <= 31

References: 8383a3f81194 ("drm/i915/icl: fix transcoder state readout")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Madhav Chauhan <madhav.chauhan@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190116155421.7660-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_display.c