Home Home > GIT Browse > SLE11-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-06-11 11:14:00 +0200
committerJohannes Thumshirn <jthumshirn@suse.de>2018-06-11 11:14:03 +0200
commitb5ab2d735a7ce879e545bc1b3355551a27470a00 (patch)
treeb9476055d5cda323c9791b8e7f99f507c0e149ff
parenteb71908d5e8e4ad32fa642fd33b4417f01034245 (diff)
s390/cpum_sf: ensure sample frequency of perf event attributes
is non-zero (bnc#1096746, LTC#168035). suse-commit: 9924be14e22ec334caea57f3fe5258b8cdf9ed45
-rw-r--r--arch/s390/kernel/perf_cpum_sf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c
index 5fa211c40fff..06fa872e95da 100644
--- a/arch/s390/kernel/perf_cpum_sf.c
+++ b/arch/s390/kernel/perf_cpum_sf.c
@@ -743,6 +743,10 @@ static int __hw_perf_event_init(struct perf_event *event)
*/
rate = 0;
if (attr->freq) {
+ if (!attr->sample_freq) {
+ err = -EINVAL;
+ goto out;
+ }
rate = freq_to_sample_rate(&si, attr->sample_freq);
rate = hw_limit_rate(&si, rate);
attr->freq = 0;