qdisc: meta return ENOMEM on alloc failure
Subsystems (3)
PATCH 1/1 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 <[email protected]>
net/sched/em_meta.c +3 -1
@@ -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));
Quoted 4 lines · Stephen Hemminger
Rather than returning earlier value (EINVAL), return ENOMEM if kzalloc fails. Found while reviewing to find another EINVAL condition.
Signed-off-by Stephen Hemminger <[email protected]>
Acked-by Thomas Graf <[email protected]>
From: Stephen Hemminger <[email protected]>
Date: Thu, 26 Sep 2013 17:40:11 -0700
Quoted 4 lines
Rather than returning earlier value (EINVAL), return ENOMEM if kzalloc fails. Found while reviewing to find another EINVAL condition.
Signed-off-by Stephen Hemminger <[email protected]>
Applied.