struct Qdisc *sch = q->sch;
        spinlock_t *root_lock;
        siphash_key_t nkey;
+       int period;
 
        get_random_bytes(&nkey, sizeof(nkey));
        rcu_read_lock();
                sfq_rehash(sch);
        spin_unlock(root_lock);
 
-       if (q->perturb_period)
-               mod_timer(&q->perturb_timer, jiffies + q->perturb_period);
+       /* q->perturb_period can change under us from
+        * sfq_change() and sfq_destroy().
+        */
+       period = READ_ONCE(q->perturb_period);
+       if (period)
+               mod_timer(&q->perturb_timer, jiffies + period);
        rcu_read_unlock();
 }
 
                q->quantum = ctl->quantum;
                q->scaled_quantum = SFQ_ALLOT_SIZE(q->quantum);
        }
-       q->perturb_period = ctl->perturb_period * HZ;
+       WRITE_ONCE(q->perturb_period, ctl->perturb_period * HZ);
        if (ctl->flows)
                q->maxflows = min_t(u32, ctl->flows, SFQ_MAX_FLOWS);
        if (ctl->divisor) {
        struct sfq_sched_data *q = qdisc_priv(sch);
 
        tcf_block_put(q->block);
-       q->perturb_period = 0;
+       WRITE_ONCE(q->perturb_period, 0);
        del_timer_sync(&q->perturb_timer);
        sfq_free(q->ht);
        sfq_free(q->slots);