[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130926174011.22632779@nehalam.linuxnetplumber.net>
Date: Thu, 26 Sep 2013 17:40:11 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: David Miller <davem@...emloft.net>, Thomas Graf <tgraf@...g.ch>
Cc: netdev@...r.kernel.org
Subject: [PATCH net-next] 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@...workplumber.org>
--- a/net/sched/em_meta.c 2013-08-10 10:36:11.657498301 -0700
+++ b/net/sched/em_meta.c 2013-09-05 16:47:43.915846185 -0700
@@ -793,8 +793,10 @@ static int em_meta_change(struct tcf_pro
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));
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists