Skip to content

Commit 9c5075f

Browse files
Bowen Yurafaeljw
authored andcommitted
cpufreq: Replace magic number
Setting the length of str_governor with a magic number could cause overflow when max length increases, it is better to use the defined macro in this case. Signed-off-by: Bowen Yu <yubowen8@huawei.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Link: https://patch.msgid.link/20250519070908.930879-1-yubowen8@huawei.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent fd3d883 commit 9c5075f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cpufreq/cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ static ssize_t show_scaling_governor(struct cpufreq_policy *policy, char *buf)
806806
static ssize_t store_scaling_governor(struct cpufreq_policy *policy,
807807
const char *buf, size_t count)
808808
{
809-
char str_governor[16];
809+
char str_governor[CPUFREQ_NAME_LEN];
810810
int ret;
811811

812812
ret = sscanf(buf, "%15s", str_governor);

0 commit comments

Comments
 (0)