Skip to content

Commit

Permalink
net: sched: fix error path in tcf_proto_create() when modules are not…
Browse files Browse the repository at this point in the history
… configured

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

Fixes: 33a4892 ("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>
  • Loading branch information
jpirko authored and davem330 committed May 11, 2018
1 parent f4d641a commit d68d75f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/cls_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ static struct tcf_proto *tcf_proto_create(const char *kind, u32 protocol,
NL_SET_ERR_MSG(extack, "TC classifier not found");
err = -ENOENT;
}
goto errout;
#endif
goto errout;
}
tp->classify = tp->ops->classify;
tp->protocol = protocol;
Expand Down

0 comments on commit d68d75f

Please sign in to comment.