diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 23742126f47c848b81f38a15af23f30593230354..7c59c28afcc524467f6d1824dccc2442e540c6a6 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -37,7 +37,7 @@ double stddev_stats(struct stats *stats) { double variance, variance_mean; - if (!stats->n) + if (stats->n < 2) return 0.0; variance = stats->M2 / (stats->n - 1);