]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/reg: fix undefined behavior due to shift overflowing the constant
authorJani Nikula <jani.nikula@intel.com>
Wed, 18 May 2022 11:33:14 +0000 (14:33 +0300)
committerJani Nikula <jani.nikula@intel.com>
Thu, 19 May 2022 08:00:46 +0000 (11:00 +0300)
commit91e6f21941294aa633b208c35a0064def95c55a3
treed98cc4da24e2b35b07de5efa62d2039007527f3a
parentb05611d95e00dc75d953b450fc9a868f55028eb0
drm/i915/reg: fix undefined behavior due to shift overflowing the constant

Use REG_GENMASK() and REG_FIELD_PREP() to avoid errors due to
-fsanitize=shift.

References: https://lore.kernel.org/r/20220405151517.29753-12-bp@alien8.de
Reported-by: Borislav Petkov <bp@suse.de>
Reported-by: Ruiqi GONG <gongruiqi1@huawei.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220518113315.1305027-1-jani.nikula@intel.com
drivers/gpu/drm/i915/i915_reg.h