Commit 0c4e4020 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

qdisc: meta return ENOMEM on alloc failure

Rather than returning earlier value (EINVAL), return ENOMEM if
kzalloc fails. Found while reviewing to find another EINVAL condition.
Signed-off-by: default avatarStephen Hemminger <stephen@networkplumber.org>
Acked-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 90de527d
...@@ -793,8 +793,10 @@ static int em_meta_change(struct tcf_proto *tp, void *data, int len, ...@@ -793,8 +793,10 @@ static int em_meta_change(struct tcf_proto *tp, void *data, int len,
goto errout; goto errout;
meta = kzalloc(sizeof(*meta), GFP_KERNEL); meta = kzalloc(sizeof(*meta), GFP_KERNEL);
if (meta == NULL) if (meta == NULL) {
err = -ENOMEM;
goto errout; goto errout;
}
memcpy(&meta->lvalue.hdr, &hdr->left, sizeof(hdr->left)); memcpy(&meta->lvalue.hdr, &hdr->left, sizeof(hdr->left));
memcpy(&meta->rvalue.hdr, &hdr->right, sizeof(hdr->right)); memcpy(&meta->rvalue.hdr, &hdr->right, sizeof(hdr->right));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment