diff options
| author | Mike Leach <[email protected]> | 2020-10-29 16:45:59 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2020-10-29 19:10:25 +0000 |
| commit | 39a7661dcf655c8198fd5d72412f5030a8e58444 (patch) | |
| tree | 7da5c048502a0ea30f47a2287d04f060acc6b4a3 /scripts/gcc-plugins/cyc_complexity_plugin.c | |
| parent | coresight: add module license (diff) | |
| download | kernel-39a7661dcf655c8198fd5d72412f5030a8e58444.tar.gz kernel-39a7661dcf655c8198fd5d72412f5030a8e58444.zip | |
coresight: Fix uninitialised pointer bug in etm_setup_aux()
Commit [bb1860efc817] changed the sink handling code introducing an
uninitialised pointer bug. This results in the default sink selection
failing.
Prior to commit:
static void etm_setup_aux(...)
<snip>
struct coresight_device *sink;
<snip>
/* First get the selected sink from user space. */
if (event->attr.config2) {
id = (u32)event->attr.config2;
sink = coresight_get_sink_by_id(id);
} else {
sink = coresight_get_enabled_sink(true);
}
<ctd>
*sink always initialised - possibly to NULL which triggers the
automatic sink selection.
After commit:
static void etm_setup_aux(...)
<snip>
struct coresight_device *sink;
<snip>
/* First get the selected sink from user space. */
if (event->attr.config2) {
id = (u32)event->attr.config2;
sink = coresight_get_sink_by_id(id);
}
<ctd>
*sink pointer uninitialised when not providing a sink on the perf command
line. This breaks later checks to enable automatic sink selection.
Fixes: bb1860efc817 ("coresight: etm: perf: Sink selection using sysfs is deprecated")
Signed-off-by: Mike Leach <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'scripts/gcc-plugins/cyc_complexity_plugin.c')
0 files changed, 0 insertions, 0 deletions
