[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1472795840-31901-4-git-send-email-xiyou.wangcong@gmail.com>
Date: Thu, 1 Sep 2016 22:57:17 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: netdev@...r.kernel.org
Cc: jhs@...atatu.com, Cong Wang <xiyou.wangcong@...il.com>
Subject: [RFC Patch net-next 3/6] net_sched: return NULL in tcf_hash_check()
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 <jhs@...atatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@...il.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
Powered by blists - more mailing lists