summaryrefslogtreecommitdiff
path: root/scripts/const_structs.checkpatch
diff options
context:
space:
mode:
authorHarry Wentland <harry.wentland@amd.com>2026-08-04 17:04:04 -0400
committerAlex Deucher <alexander.deucher@amd.com>2026-08-19 10:14:28 -0400
commit4f40873f8a4107df2b9c8e68c947c4fd0cd519d2 (patch)
tree7004b6d0beb2547a20ec19948c25c0fe9a464118 /scripts/const_structs.checkpatch
parent0e4ef0ead600e367b4dd431daa97a345a5ff8a86 (diff)
downloadlinux-4f40873f8a4107df2b9c8e68c947c4fd0cd519d2.tar.gz
linux-4f40873f8a4107df2b9c8e68c947c4fd0cd519d2.zip
drm/amd/display: avoid divide-by-zero in __is_lut_linear()
__is_lut_linear() computes the expected value of each entry with expected = i * MAX_DRM_LUT_VALUE / (size - 1); If it is ever called with a single-entry LUT, size - 1 is zero and the kernel takes a divide error (#DE). A LUT with fewer than two entries cannot describe a linear mapping anyway, so return false early instead of dividing by zero. Fixes: 086247a4b2fb ("drm/amd/display: Use 4096 lut entries") Cc: stable@vger.kernel.org Signed-off-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Melissa Wen <mwen@igalia.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions