When we don't find an action with a specific index, we only return false but not touch *a. It is nicer if we could set *a to NULL here, this would make callers easier to use these API's.
Cc: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- net/sched/act_api.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sched/act_api.c b/net/sched/act_api.c index db907e5..d0a7db2 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -230,6 +230,7 @@ bool tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action **a, *a = p; return true; } + *a = NULL; return false; } EXPORT_SYMBOL(tcf_hash_check); -- 2.1.0