提交 a4a16bea 编写于 作者: E Eric Dumazet 提交者: Robert Richter

oprofile: fix an overflow in ppro code

reset_value was changed from long to u64 in commit
b9917028 (oprofile: Implement Intel
architectural perfmon support)

But dynamic allocation of this array use a wrong type (long instead of
u64)

Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: NRobert Richter <robert.richter@amd.com>
上级 9bf1a244
...@@ -69,7 +69,7 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs) ...@@ -69,7 +69,7 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs)
int i; int i;
if (!reset_value) { if (!reset_value) {
reset_value = kmalloc(sizeof(unsigned) * num_counters, reset_value = kmalloc(sizeof(reset_value[0]) * num_counters,
GFP_ATOMIC); GFP_ATOMIC);
if (!reset_value) if (!reset_value)
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册