* [PATCH net-next] qdisc: meta return ENOMEM on alloc failure
@ 2013-09-27 0:40 Stephen Hemminger
2013-09-27 23:31 ` Thomas Graf
2013-09-30 19:48 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Stephen Hemminger @ 2013-09-27 0:40 UTC (permalink / raw)
To: David Miller, Thomas Graf; +Cc: netdev
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>
--- 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));
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-09-30 19:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-27 0:40 [PATCH net-next] qdisc: meta return ENOMEM on alloc failure Stephen Hemminger
2013-09-27 23:31 ` Thomas Graf
2013-09-30 19:48 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).