Commit f7a54c13 authored by Jarek Poplawski's avatar Jarek Poplawski Committed by David S. Miller

pkt_sched: Use rcu_assign_pointer() to change dev_queue->qdisc

These pointers are RCU protected, so proper primitives should be used.
Signed-off-by: default avatarJarek Poplawski <jarkao2@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 666d9bbe
...@@ -635,7 +635,7 @@ static struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, ...@@ -635,7 +635,7 @@ static struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
if (qdisc == NULL) if (qdisc == NULL)
qdisc = &noop_qdisc; qdisc = &noop_qdisc;
dev_queue->qdisc_sleeping = qdisc; dev_queue->qdisc_sleeping = qdisc;
dev_queue->qdisc = &noop_qdisc; rcu_assign_pointer(dev_queue->qdisc, &noop_qdisc);
spin_unlock_bh(root_lock); spin_unlock_bh(root_lock);
......
...@@ -634,7 +634,7 @@ static void dev_deactivate_queue(struct net_device *dev, ...@@ -634,7 +634,7 @@ static void dev_deactivate_queue(struct net_device *dev,
if (!(qdisc->flags & TCQ_F_BUILTIN)) if (!(qdisc->flags & TCQ_F_BUILTIN))
set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state); set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state);
dev_queue->qdisc = qdisc_default; rcu_assign_pointer(dev_queue->qdisc, qdisc_default);
qdisc_reset(qdisc); qdisc_reset(qdisc);
spin_unlock_bh(qdisc_lock(qdisc)); spin_unlock_bh(qdisc_lock(qdisc));
...@@ -709,7 +709,7 @@ static void shutdown_scheduler_queue(struct net_device *dev, ...@@ -709,7 +709,7 @@ static void shutdown_scheduler_queue(struct net_device *dev,
struct Qdisc *qdisc_default = _qdisc_default; struct Qdisc *qdisc_default = _qdisc_default;
if (qdisc) { if (qdisc) {
dev_queue->qdisc = qdisc_default; rcu_assign_pointer(dev_queue->qdisc, qdisc_default);
dev_queue->qdisc_sleeping = qdisc_default; dev_queue->qdisc_sleeping = qdisc_default;
qdisc_destroy(qdisc); qdisc_destroy(qdisc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment