Skip to content

Commit bd42b78

Browse files
jpirkodavem330
authored andcommitted
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>
1 parent 0f6538c commit bd42b78

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

net/sched/cls_basic.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,9 @@ static int basic_change(struct net *net, struct sk_buff *in_skb,
178178
return -EINVAL;
179179
}
180180

181-
err = -ENOBUFS;
182181
fnew = kzalloc(sizeof(*fnew), GFP_KERNEL);
183-
if (fnew == NULL)
184-
goto errout;
182+
if (!fnew)
183+
return -ENOBUFS;
185184

186185
tcf_exts_init(&fnew->exts, TCA_BASIC_ACT, TCA_BASIC_POLICE);
187186
err = -EINVAL;

0 commit comments

Comments
 (0)