alistair23-linux/tools/power/x86/x86_energy_perf_policy
Zephaniah E. Loss-Cutler-Hull 0353148240 tools/power x86_energy_perf_policy: Fix argument parsing
The -w argument in x86_energy_perf_policy currently triggers an
unconditional segfault.

This is because the argument string reads: "+a:c:dD:E:e:f:m:M:rt:u:vw" and
yet the argument handler expects an argument.

When parse_optarg_string is called with a null argument, we then proceed to
crash in strncmp, not horribly friendly.

The man page describes -w as taking an argument, the long form
(--hwp-window) is correctly marked as taking a required argument, and the
code expects it.

As such, this patch simply marks the short form (-w) as requiring an
argument.

Signed-off-by: Zephaniah E. Loss-Cutler-Hull <zephaniah@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2019-08-31 14:48:34 -04:00
..
Makefile tools/power/x86: Enable compiler optimisations and Fortify by default 2019-08-31 14:48:34 -04:00
x86_energy_perf_policy.8 tools/power: Fix typo in man page 2019-08-31 14:48:34 -04:00
x86_energy_perf_policy.c tools/power x86_energy_perf_policy: Fix argument parsing 2019-08-31 14:48:34 -04:00