diff options
author | Jiri Pirko <jiri@mellanox.com> | 2018-05-11 11:45:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-11 16:34:38 -0400 |
commit | d68d75fdc34b0253c2bded7ed18cd60eb5a9599b (patch) | |
tree | dd5a0c560c891823e6341b61bde23338d477c700 /net/sched/cls_api.c | |
parent | f4d641a2288504d7761e715a922fc675ddc2e594 (diff) |
net: sched: fix error path in tcf_proto_create() when modules are not configured
In case modules are not configured, error out when tp->ops is null
and prevent later null pointer dereference.
Fixes: 33a48927c193 ("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>
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r-- | net/sched/cls_api.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index b66754f52a9f..963e4bf0aab8 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -152,8 +152,8 @@ static struct tcf_proto *tcf_proto_create(const char *kind, u32 protocol, | |||
152 | NL_SET_ERR_MSG(extack, "TC classifier not found"); | 152 | NL_SET_ERR_MSG(extack, "TC classifier not found"); |
153 | err = -ENOENT; | 153 | err = -ENOENT; |
154 | } | 154 | } |
155 | goto errout; | ||
156 | #endif | 155 | #endif |
156 | goto errout; | ||
157 | } | 157 | } |
158 | tp->classify = tp->ops->classify; | 158 | tp->classify = tp->ops->classify; |
159 | tp->protocol = protocol; | 159 | tp->protocol = protocol; |