]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
oprofile: fix an overflow in ppro code
authorEric Dumazet <dada1@cosmosbay.com>
Mon, 10 Nov 2008 08:05:37 +0000 (09:05 +0100)
committerRobert Richter <robert.richter@amd.com>
Mon, 17 Nov 2008 17:47:36 +0000 (18:47 +0100)
reset_value was changed from long to u64 in commit
b99170288421c79f0c2efa8b33e26e65f4bb7fb8 (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: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
arch/x86/oprofile/op_model_ppro.c

index 3f1b81a83e2e5be2ebd1cabde2a66b71ccd20306..716d26f0e5d47b74ae43abb862d7d296c17ef609 100644 (file)
@@ -69,7 +69,7 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs)
        int i;
 
        if (!reset_value) {
-               reset_value = kmalloc(sizeof(unsigned) * num_counters,
+               reset_value = kmalloc(sizeof(reset_value[0]) * num_counters,
                                        GFP_ATOMIC);
                if (!reset_value)
                        return;