* re: perf/x86/intel: Fix LBR callstack issue caused by FREEZE_LBRS_ON_PMI
@ 2015-09-14 20:43 Dan Carpenter
2015-09-14 21:03 ` Liang, Kan
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-09-14 20:43 UTC (permalink / raw)
To: kernel-janitors
Hello Kan Liang,
This is a semi-automatic email about new static checker warnings.
The patch deb27519bf1f: "perf/x86/intel: Fix LBR callstack issue
caused by FREEZE_LBRS_ON_PMI" from Aug 17, 2015, leads to the
following Smatch complaint:
arch/x86/kernel/cpu/perf_event_intel_lbr.c:155 __intel_pmu_lbr_enable()
warn: variable dereferenced before check 'cpuc->lbr_sel' (see line 154)
arch/x86/kernel/cpu/perf_event_intel_lbr.c
153 */
154 lbr_select = cpuc->lbr_sel->config;
^^^^^^^^^^^^^^^^^^^^^
New unchecked dereference.
155 if (cpuc->lbr_sel && !pmi)
^^^^^^^^^^^^^
Old code assumes it can be NULL.
156 wrmsrl(MSR_LBR_SELECT, lbr_select);
157
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: perf/x86/intel: Fix LBR callstack issue caused by FREEZE_LBRS_ON_PMI
2015-09-14 20:43 perf/x86/intel: Fix LBR callstack issue caused by FREEZE_LBRS_ON_PMI Dan Carpenter
@ 2015-09-14 21:03 ` Liang, Kan
0 siblings, 0 replies; 2+ messages in thread
From: Liang, Kan @ 2015-09-14 21:03 UTC (permalink / raw)
To: kernel-janitors
>
> Hello Kan Liang,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch deb27519bf1f: "perf/x86/intel: Fix LBR callstack issue caused by
> FREEZE_LBRS_ON_PMI" from Aug 17, 2015, leads to the following Smatch
> complaint:
>
> arch/x86/kernel/cpu/perf_event_intel_lbr.c:155 __intel_pmu_lbr_enable()
> warn: variable dereferenced before check 'cpuc->lbr_sel' (see line
> 154)
>
> arch/x86/kernel/cpu/perf_event_intel_lbr.c
> 153 */
> 154 lbr_select = cpuc->lbr_sel->config;
> ^^^^^^^^^^^^^^^^^^^^^ New unchecked dereference.
>
> 155 if (cpuc->lbr_sel && !pmi)
> ^^^^^^^^^^^^^
> Old code assumes it can be NULL.
>
> 156 wrmsrl(MSR_LBR_SELECT, lbr_select);
> 157
>
Thanks.
I will send out a new patch to fix it.
Regards,
Kan
> regards,
> dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-14 21:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-14 20:43 perf/x86/intel: Fix LBR callstack issue caused by FREEZE_LBRS_ON_PMI Dan Carpenter
2015-09-14 21:03 ` Liang, Kan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.