perf_counter/powerpc: Check oprofile_cpu_type for NULL before using it
[pandora-kernel.git] / arch / powerpc / kernel / mpc7450-pmu.c
index c244133..cc466d0 100644 (file)
@@ -407,7 +407,8 @@ struct power_pmu mpc7450_pmu = {
 
 static int init_mpc7450_pmu(void)
 {
-       if (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc/7450"))
+       if (!cur_cpu_spec->oprofile_cpu_type ||
+           strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc/7450"))
                return -ENODEV;
 
        return register_power_pmu(&mpc7450_pmu);