net: sched: fix error path in tcf_proto_create() when modules are not configured

[ Upstream commit d68d75fdc3 ]

In case modules are not configured, error out when tp->ops is null
and prevent later null pointer dereference.

Fixes: 33a48927c1 ("sched: push TC filter protocol creation into a separate function")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jiri Pirko 2018-05-11 17:45:32 +02:00 committed by Greg Kroah-Hartman
parent f6294114ad
commit b047794cc3

View file

@ -151,8 +151,8 @@ static struct tcf_proto *tcf_proto_create(const char *kind, u32 protocol,
} else {
err = -ENOENT;
}
goto errout;
#endif
goto errout;
}
tp->classify = tp->ops->classify;
tp->protocol = protocol;