Message ID | 1485193284-31636-2-git-send-email-mathieu.poirier@linaro.org |
---|---|
State | New |
Headers | show |
Series | coresight: next v4.10-rc5 | expand |
On Mon, Jan 23, 2017 at 10:41:22AM -0700, Mathieu Poirier wrote: > From: Wang Nan <wangnan0@huawei.com> > > Commit d52c9750f150 ("coresight: reset "enable_sink" flag when need be") > caused a kernel panic because of the using of an invalid value: after > 'for_each_cpu(cpu, mask)', value of local variable 'cpu' become invalid, > causes following 'cpu_to_node' access invalid memory area. You should add a "Fixes:" tag when you write something like this, as you have all of the information here. I'll add it, and the stable tag as well... thanks, greg k-h
diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c index 17741969026e..26cfac3e6de7 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -242,6 +242,7 @@ static void *etm_setup_aux(int event_cpu, void **pages, if (!sink_ops(sink)->alloc_buffer) goto err; + cpu = cpumask_first(mask); /* Get the AUX specific data from the sink buffer */ event_data->snk_config = sink_ops(sink)->alloc_buffer(sink, cpu, pages,