]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/oprofile/op_model_ppro.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[linux-2.6-omap-h63xx.git] / arch / x86 / oprofile / op_model_ppro.c
index 3f1b81a83e2e5be2ebd1cabde2a66b71ccd20306..e9f80c744cf3409d72f77dd9044ec1dd90534609 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;
@@ -156,6 +156,8 @@ static void ppro_start(struct op_msrs const * const msrs)
        unsigned int low, high;
        int i;
 
+       if (!reset_value)
+               return;
        for (i = 0; i < num_counters; ++i) {
                if (reset_value[i]) {
                        CTRL_READ(low, high, msrs, i);
@@ -171,6 +173,8 @@ static void ppro_stop(struct op_msrs const * const msrs)
        unsigned int low, high;
        int i;
 
+       if (!reset_value)
+               return;
        for (i = 0; i < num_counters; ++i) {
                if (!reset_value[i])
                        continue;