diff options
author | Jiri Pirko <jiri@resnulli.us> | 2014-12-05 15:50:22 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-12-09 15:41:56 -0500 |
commit | bd42b788607b850b84e7c754d351cbec93c681e1 (patch) | |
tree | a0da9d702decd99a5f6164ac9b7feb8fd85e2d72 /net/sched | |
parent | 0f6538c271997ef473ee601e2213157adc97e2b3 (diff) | |
download | linux-stable-bd42b788607b850b84e7c754d351cbec93c681e1.tar.gz linux-stable-bd42b788607b850b84e7c754d351cbec93c681e1.tar.bz2 linux-stable-bd42b788607b850b84e7c754d351cbec93c681e1.zip |
net: sched: cls_basic: fix error path in basic_change()
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Reviewed-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/cls_basic.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c index 7cf0a62fc4c9..5aed341406c2 100644 --- a/net/sched/cls_basic.c +++ b/net/sched/cls_basic.c @@ -178,10 +178,9 @@ static int basic_change(struct net *net, struct sk_buff *in_skb, return -EINVAL; } - err = -ENOBUFS; fnew = kzalloc(sizeof(*fnew), GFP_KERNEL); - if (fnew == NULL) - goto errout; + if (!fnew) + return -ENOBUFS; tcf_exts_init(&fnew->exts, TCA_BASIC_ACT, TCA_BASIC_POLICE); err = -EINVAL; |