From: Jiri Pirko Date: Fri, 5 Dec 2014 14:50:22 +0000 (+0100) Subject: net: sched: cls_basic: fix error path in basic_change() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bd42b788607b850b84e7c754d351cbec93c681e1;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git net: sched: cls_basic: fix error path in basic_change() Signed-off-by: Jiri Pirko Reviewed-by: John Fastabend Signed-off-by: David S. Miller --- 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;