From cee63723b358e594225e812d6e14a2a0abfd5c88 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Wed, 23 Jan 2008 20:33:32 -0800 Subject: [NET_SCHED]: Propagate nla_parse return value nla_parse() returns more detailed errno codes, propagate them back on error. Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- net/sched/ematch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'net/sched/ematch.c') diff --git a/net/sched/ematch.c b/net/sched/ematch.c index 72d9b27..d2b480f 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c @@ -301,7 +301,7 @@ errout: int tcf_em_tree_validate(struct tcf_proto *tp, struct nlattr *nla, struct tcf_ematch_tree *tree) { - int idx, list_len, matches_len, err = -EINVAL; + int idx, list_len, matches_len, err; struct nlattr *tb[TCA_EMATCH_TREE_MAX + 1]; struct nlattr *rt_match, *rt_hdr, *rt_list; struct tcf_ematch_tree_hdr *tree_hdr; @@ -312,9 +312,11 @@ int tcf_em_tree_validate(struct tcf_proto *tp, struct nlattr *nla, return 0; } - if (nla_parse_nested(tb, TCA_EMATCH_TREE_MAX, nla, NULL) < 0) + err = nla_parse_nested(tb, TCA_EMATCH_TREE_MAX, nla, NULL); + if (err < 0) goto errout; + err = -EINVAL; rt_hdr = tb[TCA_EMATCH_TREE_HDR]; rt_list = tb[TCA_EMATCH_TREE_LIST]; -- cgit v1.1