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

Commit eb4a5527 authored by Jarek Poplawski's avatar Jarek Poplawski Committed by David S. Miller
Browse files

pkt_sched: Fix sch_sfq vs tcf_bind_filter oops



Since there was added ->tcf_chain() method without ->bind_tcf() to
sch_sfq class options, there is oops when a filter is added with
the classid parameter.

Fixes commit 7d2681a6
netdev thread: null pointer at cls_api.c

Signed-off-by: default avatarJarek Poplawski <jarkao2@gmail.com>
Reported-by: default avatarFranchoze Eric <franchoze@yandex.ru>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cece1945
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -513,6 +513,12 @@ static unsigned long sfq_get(struct Qdisc *sch, u32 classid)
	return 0;
	return 0;
}
}


static unsigned long sfq_bind(struct Qdisc *sch, unsigned long parent,
			      u32 classid)
{
	return 0;
}

static struct tcf_proto **sfq_find_tcf(struct Qdisc *sch, unsigned long cl)
static struct tcf_proto **sfq_find_tcf(struct Qdisc *sch, unsigned long cl)
{
{
	struct sfq_sched_data *q = qdisc_priv(sch);
	struct sfq_sched_data *q = qdisc_priv(sch);
@@ -567,6 +573,7 @@ static void sfq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
static const struct Qdisc_class_ops sfq_class_ops = {
static const struct Qdisc_class_ops sfq_class_ops = {
	.get		=	sfq_get,
	.get		=	sfq_get,
	.tcf_chain	=	sfq_find_tcf,
	.tcf_chain	=	sfq_find_tcf,
	.bind_tcf	=	sfq_bind,
	.dump		=	sfq_dump_class,
	.dump		=	sfq_dump_class,
	.dump_stats	=	sfq_dump_class_stats,
	.dump_stats	=	sfq_dump_class_stats,
	.walk		=	sfq_walk,
	.walk		=	sfq_walk,