Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92833e8b authored by Vlad Buslov's avatar Vlad Buslov Committed by Greg Kroah-Hartman
Browse files

net: sched: rename qdisc_destroy() to qdisc_put()



[ Upstream commit 86bd446b5cebd783187ea3772ff258210de77d99 ]

Current implementation of qdisc_destroy() decrements Qdisc reference
counter and only actually destroy Qdisc if reference counter value reached
zero. Rename qdisc_destroy() to qdisc_put() in order for it to better
describe the way in which this function currently implemented and used.

Extract code that deallocates Qdisc into new private qdisc_destroy()
function. It is intended to be shared between regular qdisc_put() and its
unlocked version that is introduced in next patch in this series.

Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
[Lee: Sent to Stable]
Link: https://syzkaller.appspot.com/bug?id=d7e411c5472dd5da33d8cc921ccadc747743a568


Reported-by: default avatar <syzbot+5f229e48cccc804062c0@syzkaller.appspotmail.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cd25f109
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -559,7 +559,7 @@ void dev_deactivate_many(struct list_head *head);
struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
			      struct Qdisc *qdisc);
void qdisc_reset(struct Qdisc *qdisc);
void qdisc_destroy(struct Qdisc *qdisc);
void qdisc_put(struct Qdisc *qdisc);
void qdisc_tree_reduce_backlog(struct Qdisc *qdisc, unsigned int n,
			       unsigned int len);
struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
+3 −3
Original line number Diff line number Diff line
@@ -928,7 +928,7 @@ static void notify_and_destroy(struct net *net, struct sk_buff *skb,
		qdisc_notify(net, skb, n, clid, old, new);

	if (old)
		qdisc_destroy(old);
		qdisc_put(old);
}

/* Graft qdisc "new" to class "classid" of qdisc "parent" or
@@ -981,7 +981,7 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
				qdisc_refcount_inc(new);

			if (!ingress)
				qdisc_destroy(old);
				qdisc_put(old);
		}

skip:
@@ -1589,7 +1589,7 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
	err = qdisc_graft(dev, p, skb, n, clid, q, NULL, extack);
	if (err) {
		if (q)
			qdisc_destroy(q);
			qdisc_put(q);
		return err;
	}

+1 −1
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ static void atm_tc_put(struct Qdisc *sch, unsigned long cl)
	pr_debug("atm_tc_put: destroying\n");
	list_del_init(&flow->list);
	pr_debug("atm_tc_put: qdisc %p\n", flow->q);
	qdisc_destroy(flow->q);
	qdisc_put(flow->q);
	tcf_block_put(flow->block);
	if (flow->sock) {
		pr_debug("atm_tc_put: f_count %ld\n",
+1 −1
Original line number Diff line number Diff line
@@ -1439,7 +1439,7 @@ static void cbq_destroy_class(struct Qdisc *sch, struct cbq_class *cl)
	WARN_ON(cl->filters);

	tcf_block_put(cl->block);
	qdisc_destroy(cl->q);
	qdisc_put(cl->q);
	qdisc_put_rtab(cl->R_tab);
	gen_kill_estimator(&cl->rate_est);
	if (cl != &q->link)
+1 −1
Original line number Diff line number Diff line
@@ -452,7 +452,7 @@ static void cbs_destroy(struct Qdisc *sch)
	cbs_disable_offload(dev, q);

	if (q->qdisc)
		qdisc_destroy(q->qdisc);
		qdisc_put(q->qdisc);
}

static int cbs_dump(struct Qdisc *sch, struct sk_buff *skb)
Loading