aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2014-12-05 09:50:22 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-09 15:41:56 -0500
commitbd42b788607b850b84e7c754d351cbec93c681e1 (patch)
treea0da9d702decd99a5f6164ac9b7feb8fd85e2d72
parent0f6538c271997ef473ee601e2213157adc97e2b3 (diff)
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>
-rw-r--r--net/sched/cls_basic.c5
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,
178 return -EINVAL; 178 return -EINVAL;
179 } 179 }
180 180
181 err = -ENOBUFS;
182 fnew = kzalloc(sizeof(*fnew), GFP_KERNEL); 181 fnew = kzalloc(sizeof(*fnew), GFP_KERNEL);
183 if (fnew == NULL) 182 if (!fnew)
184 goto errout; 183 return -ENOBUFS;
185 184
186 tcf_exts_init(&fnew->exts, TCA_BASIC_ACT, TCA_BASIC_POLICE); 185 tcf_exts_init(&fnew->exts, TCA_BASIC_ACT, TCA_BASIC_POLICE);
187 err = -EINVAL; 186 err = -EINVAL;