Skip to content

Commit fb803d4

Browse files
Denis Arefevgregkh
authored andcommitted
drm/amd/pm/swsmu/smu13/smu_v13_0: Prevent division by zero
commit f23e911 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: c05d1c4 ("drm/amd/swsmu: add aldebaran smu13 ip support (v3)") Signed-off-by: Denis Arefev <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8e9c4f8 commit fb803d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ int smu_v13_0_set_fan_speed_rpm(struct smu_context *smu,
12281228
uint32_t tach_period;
12291229
int ret;
12301230

1231-
if (!speed)
1231+
if (!speed || speed > UINT_MAX/8)
12321232
return -EINVAL;
12331233

12341234
ret = smu_v13_0_auto_fan_control(smu, 0);

0 commit comments

Comments
 (0)