]> git.ipfire.org Git - people/ms/linux.git/blobdiff - block/blk-throttle.c
blk-throttle: check stats_cpu before reading it from sysfs
[people/ms/linux.git] / block / blk-throttle.c
index 9273d0969ebd6377a02cf0be189d34ea619afe3e..5b9c6d5c3636ad6412c7b898c44e4709b35597d1 100644 (file)
@@ -1292,6 +1292,9 @@ static u64 tg_prfill_cpu_rwstat(struct seq_file *sf,
        struct blkg_rwstat rwstat = { }, tmp;
        int i, cpu;
 
+       if (tg->stats_cpu == NULL)
+               return 0;
+
        for_each_possible_cpu(cpu) {
                struct tg_stats_cpu *sc = per_cpu_ptr(tg->stats_cpu, cpu);