diff options
author | Patrick McHardy <kaber@trash.net> | 2008-01-23 23:33:32 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:11:18 -0500 |
commit | cee63723b358e594225e812d6e14a2a0abfd5c88 (patch) | |
tree | 847f929e0f445cca8cdf55d7c17a56b0d0f2ec68 /net/sched/em_meta.c | |
parent | ab27cfb85c5778400740ad0c401bde65616774eb (diff) |
[NET_SCHED]: Propagate nla_parse return value
nla_parse() returns more detailed errno codes, propagate them back on
error.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/em_meta.c')
-rw-r--r-- | net/sched/em_meta.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c index 92b6863e928d..dd5723670d31 100644 --- a/net/sched/em_meta.c +++ b/net/sched/em_meta.c | |||
@@ -749,14 +749,16 @@ static inline int meta_is_supported(struct meta_value *val) | |||
749 | static int em_meta_change(struct tcf_proto *tp, void *data, int len, | 749 | static int em_meta_change(struct tcf_proto *tp, void *data, int len, |
750 | struct tcf_ematch *m) | 750 | struct tcf_ematch *m) |
751 | { | 751 | { |
752 | int err = -EINVAL; | 752 | int err; |
753 | struct nlattr *tb[TCA_EM_META_MAX + 1]; | 753 | struct nlattr *tb[TCA_EM_META_MAX + 1]; |
754 | struct tcf_meta_hdr *hdr; | 754 | struct tcf_meta_hdr *hdr; |
755 | struct meta_match *meta = NULL; | 755 | struct meta_match *meta = NULL; |
756 | 756 | ||
757 | if (nla_parse(tb, TCA_EM_META_MAX, data, len, NULL) < 0) | 757 | err = nla_parse(tb, TCA_EM_META_MAX, data, len, NULL); |
758 | if (err < 0) | ||
758 | goto errout; | 759 | goto errout; |
759 | 760 | ||
761 | err = -EINVAL; | ||
760 | if (tb[TCA_EM_META_HDR] == NULL || | 762 | if (tb[TCA_EM_META_HDR] == NULL || |
761 | nla_len(tb[TCA_EM_META_HDR]) < sizeof(*hdr)) | 763 | nla_len(tb[TCA_EM_META_HDR]) < sizeof(*hdr)) |
762 | goto errout; | 764 | goto errout; |