summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorstephen hemminger <stephen@networkplumber.org>2013-09-27 02:40:11 +0200
committerDavid S. Miller <davem@davemloft.net>2013-09-30 21:47:43 +0200
commit0c4e4020f0145ed84b0ef9e3fb79c4a022e77e47 (patch)
tree04694b8d25bba52dd554843465035a0e48261b08 /net/sched
parentbonding: trivial: remove forgotten bond_next_vlan() (diff)
downloadlinux-0c4e4020f0145ed84b0ef9e3fb79c4a022e77e47.tar.xz
linux-0c4e4020f0145ed84b0ef9e3fb79c4a022e77e47.zip
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: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/em_meta.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c
index 7c3de6ffa516..e5cef9567225 100644
--- a/net/sched/em_meta.c
+++ b/net/sched/em_meta.c
@@ -793,8 +793,10 @@ static int em_meta_change(struct tcf_proto *tp, void *data, int len,
goto errout;
meta = kzalloc(sizeof(*meta), GFP_KERNEL);
- if (meta == NULL)
+ if (meta == NULL) {
+ err = -ENOMEM;
goto errout;
+ }
memcpy(&meta->lvalue.hdr, &hdr->left, sizeof(hdr->left));
memcpy(&meta->rvalue.hdr, &hdr->right, sizeof(hdr->right));