Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/pm: Prevent division by zero

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: c05d1c401572 ("drm/amd/swsmu: add aldebaran smu13 ip support (v3)")
Signed-off-by: Denis Arefev <arefev@swemel.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org

authored by

Denis Arefev and committed by
Alex Deucher
f23e9116 cf05922d

+1 -1
+1 -1
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
··· 1226 1226 uint32_t tach_period; 1227 1227 int ret; 1228 1228 1229 - if (!speed) 1229 + if (!speed || speed > UINT_MAX/8) 1230 1230 return -EINVAL; 1231 1231 1232 1232 ret = smu_v13_0_auto_fan_control(smu, 0);