Skip to content

Commit 9232c3c

Browse files
hbruecknerMartin Schwidefsky
authored andcommitted
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>
1 parent 3d43b98 commit 9232c3c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/s390/kernel/perf_cpum_sf.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,6 +1938,9 @@ static int __init init_cpum_sampling_pmu(void)
19381938
return -ENODEV;
19391939
}
19401940

1941+
if (!si.as && !si.ad)
1942+
return -ENODEV;
1943+
19411944
if (si.bsdes != sizeof(struct hws_basic_entry)) {
19421945
pr_cpumsf_err(RS_INIT_FAILURE_BSDES);
19431946
return -EINVAL;

0 commit comments

Comments
 (0)