lkml.org 
[lkml]   [2013]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v5 3/3] PM: Introduce Intel PowerClamp Driver
From
Date
On Thu, 2013-01-03 at 07:10 -0800, Jacob Pan wrote:
> Intel PowerClamp driver performs synchronized idle injection across
> all online CPUs. The goal is to maintain a given package level C-state
> ratio.

[]

> +static int window_size_set(const char *arg, const struct kernel_param *kp)
> +{
> + int ret = 0;
> + unsigned long new_window_size;
> +
> + ret = kstrtoul(arg, 10, &new_window_size);
> + if (ret)
> + goto exit_win;
> + if (new_window_size > 10 || new_window_size < 2) {
> + pr_err("Invalid window size %lu, between 2-10\n",
> + new_window_size);
> + ret = -EINVAL;
> + }
> +
> + window_size = new_window_size;

Possible assignment of known invalid windows size?
Maybe you should add
goto exit;
after
ret = -EINVAL;

or add
new_window_size = clamp(new_window_size, 2ul, 10ul);




\
 
 \ /
  Last update: 2013-01-04 05:41    [W:0.105 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site