]> Gentwo Git Trees - linux/.git/commit
drm/i915/dsi: Fix overflow issue in pclk parsing
authorJouni Högander <jouni.hogander@intel.com>
Thu, 7 Aug 2025 04:26:35 +0000 (07:26 +0300)
committerJouni Högander <jouni.hogander@intel.com>
Thu, 7 Aug 2025 11:58:54 +0000 (14:58 +0300)
commit5fe8d1dba706ee5234acef29c4410ade89170193
tree80b5e5d054a89c8ea1e17c1df3e65233897d3238
parentf9b5bf76ea719a115502f9c1b20ab534ccd8194b
drm/i915/dsi: Fix overflow issue in pclk parsing

Parsed divider p will overflow and is considered being valid in case
pll_ctl == 0.

Fix this by checking divider p before decreasing it. Also small improvement
is made by using fls() instead of custom loop.

v2: use fls() and check parsed divider

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20250807042635.2491537-1-jouni.hogander@intel.com
drivers/gpu/drm/i915/display/vlv_dsi_pll.c