summaryrefslogtreecommitdiffstats
path: root/net/sched/em_meta.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-01-24 05:33:32 +0100
committerDavid S. Miller <davem@davemloft.net>2008-01-29 00:11:18 +0100
commitcee63723b358e594225e812d6e14a2a0abfd5c88 (patch)
tree847f929e0f445cca8cdf55d7c17a56b0d0f2ec68 /net/sched/em_meta.c
parent[NET_SCHED]: act_api: use PTR_ERR in tcf_action_init/tcf_action_get (diff)
downloadlinux-cee63723b358e594225e812d6e14a2a0abfd5c88.tar.xz
linux-cee63723b358e594225e812d6e14a2a0abfd5c88.zip
[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.c6
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)
static int em_meta_change(struct tcf_proto *tp, void *data, int len,
struct tcf_ematch *m)
{
- int err = -EINVAL;
+ int err;
struct nlattr *tb[TCA_EM_META_MAX + 1];
struct tcf_meta_hdr *hdr;
struct meta_match *meta = NULL;
- if (nla_parse(tb, TCA_EM_META_MAX, data, len, NULL) < 0)
+ err = nla_parse(tb, TCA_EM_META_MAX, data, len, NULL);
+ if (err < 0)
goto errout;
+ err = -EINVAL;
if (tb[TCA_EM_META_HDR] == NULL ||
nla_len(tb[TCA_EM_META_HDR]) < sizeof(*hdr))
goto errout;