]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amd/pm/powerplay: Prevent division by zero
authorDenis Arefev <arefev@swemel.ru>
Fri, 21 Mar 2025 11:08:15 +0000 (14:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:44:14 +0000 (07:44 +0200)
commit0c02fcbe4a1393a3c02da6ae35e72493cfdb2155
treed97578377b58a04630914169d6cb93b8d0d42caa
parentb7c41df4913789ebfe73cc1e17c6401d4c5eab69
drm/amd/pm/powerplay: Prevent division by zero

commit 4b8c3c0d17c07f301011e2908fecd2ebdcfe3d1c upstream.

The user can set any speed value.
If speed is greater than UINT_MAX/8, division by zero is possible.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: c52dcf49195d ("drm/amd/pp: Avoid divide-by-zero in fan_ctrl_set_fan_speed_rpm")
Signed-off-by: Denis Arefev <arefev@swemel.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_thermal.c