From fbd50bc2410d94cd754fc4b82881c2bf635a8b37 Mon Sep 17 00:00:00 2001 From: Yaroslav Chvanov Date: Tue, 12 Dec 2023 01:49:25 +0300 Subject: [PATCH] ratbagd-profile: cap minimum report rate to 125 Fixes the sanity check part of #1563. --- ratbagd/ratbagd-profile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ratbagd/ratbagd-profile.c b/ratbagd/ratbagd-profile.c index 08416b3b..bcf988b0 100644 --- a/ratbagd/ratbagd-profile.c +++ b/ratbagd/ratbagd-profile.c @@ -594,8 +594,11 @@ ratbagd_profile_set_report_rate(sd_bus *bus, return r; /* basic sanity check */ - if (rate > 8000) + if (rate < 125) { + rate = 125; + } else if (rate > 8000) { rate = 8000; + } r = ratbag_profile_set_report_rate(profile->lib_profile, rate); if (r == 0) {