Преглед на файлове

s390/cpum_sf: do not register PMU if no sampling mode is authorized

Previously, the cpum_sf PMU was registered even if there is no
sampling mode authorized.  Add a check and register cpum_sf only
at least one sampling mode is authorized.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Hendrik Brueckner преди 8 години
родител
ревизия
9232c3c741
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      arch/s390/kernel/perf_cpum_sf.c

+ 3 - 0
arch/s390/kernel/perf_cpum_sf.c

@@ -1938,6 +1938,9 @@ static int __init init_cpum_sampling_pmu(void)
 		return -ENODEV;
 	}
 
+	if (!si.as && !si.ad)
+		return -ENODEV;
+
 	if (si.bsdes != sizeof(struct hws_basic_entry)) {
 		pr_cpumsf_err(RS_INIT_FAILURE_BSDES);
 		return -EINVAL;