summaryrefslogtreecommitdiffstats
path: root/include/net/pkt_cls.h
diff options
context:
space:
mode:
authorCong Wang <xiyou.wangcong@gmail.com>2019-02-21 06:37:42 +0100
committerDavid S. Miller <davem@davemloft.net>2019-02-23 00:26:51 +0100
commit14215108a1fd7e002c0a1f9faf8fbaf41fdda50d (patch)
treec56c457e345a93a42c47d67d58961a534b3e663e /include/net/pkt_cls.h
parentMerge tag 'wireless-drivers-next-for-davem-2019-02-22' of git://git.kernel.or... (diff)
downloadlinux-14215108a1fd7e002c0a1f9faf8fbaf41fdda50d.tar.xz
linux-14215108a1fd7e002c0a1f9faf8fbaf41fdda50d.zip
net_sched: initialize net pointer inside tcf_exts_init()
For tcindex filter, it is too late to initialize the net pointer in tcf_exts_validate(), as tcf_exts_get_net() requires a non-NULL net pointer. We can just move its initialization into tcf_exts_init(), which just requires an additional parameter. This makes the code in tcindex_alloc_perfect_hash() prettier. Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/pkt_cls.h')
-rw-r--r--include/net/pkt_cls.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 6a530bef9253..58ea48e1221c 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -289,12 +289,13 @@ struct tcf_exts {
int police;
};
-static inline int tcf_exts_init(struct tcf_exts *exts, int action, int police)
+static inline int tcf_exts_init(struct tcf_exts *exts, struct net *net,
+ int action, int police)
{
#ifdef CONFIG_NET_CLS_ACT
exts->type = 0;
exts->nr_actions = 0;
- exts->net = NULL;
+ exts->net = net;
exts->actions = kcalloc(TCA_ACT_MAX_PRIO, sizeof(struct tc_action *),
GFP_KERNEL);
if (!exts->actions)