diff options
author | Patrick McHardy <kaber@trash.net> | 2008-01-23 20:33:13 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 15:11:17 -0800 |
commit | ab27cfb85c5778400740ad0c401bde65616774eb (patch) | |
tree | 0ba260a2a4ee2e80b75a188192f345e7bd079cfd /net/sched/cls_api.c | |
parent | c96c9471dd86ba24dc3826bf5688b99d3caf3ace (diff) | |
download | linux-3.10-ab27cfb85c5778400740ad0c401bde65616774eb.tar.gz linux-3.10-ab27cfb85c5778400740ad0c401bde65616774eb.tar.bz2 linux-3.10-ab27cfb85c5778400740ad0c401bde65616774eb.zip |
[NET_SCHED]: act_api: use PTR_ERR in tcf_action_init/tcf_action_get
Signed-off-by: Patrick McHardy <kaber@trash.net>
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 | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index d870478e364..92fa1559c21 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -23,6 +23,7 @@ #include <linux/init.h> #include <linux/kmod.h> #include <linux/netlink.h> +#include <linux/err.h> #include <net/net_namespace.h> #include <net/sock.h> #include <net/netlink.h> @@ -487,23 +488,22 @@ int tcf_exts_validate(struct tcf_proto *tp, struct nlattr **tb, #ifdef CONFIG_NET_CLS_ACT { - int err; struct tc_action *act; if (map->police && tb[map->police]) { act = tcf_action_init_1(tb[map->police], rate_tlv, "police", TCA_ACT_NOREPLACE, - TCA_ACT_BIND, &err); - if (act == NULL) - return err; + TCA_ACT_BIND); + if (IS_ERR(act)) + return PTR_ERR(act); act->type = TCA_OLD_COMPAT; exts->action = act; } else if (map->action && tb[map->action]) { act = tcf_action_init(tb[map->action], rate_tlv, NULL, - TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); - if (act == NULL) - return err; + TCA_ACT_NOREPLACE, TCA_ACT_BIND); + if (IS_ERR(act)) + return PTR_ERR(act); exts->action = act; } |