Skip to content

Commit

Permalink
net: sched: cls_basic: fix error path in basic_change()
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Pirko <[email protected]>
Reviewed-by: John Fastabend <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jpirko authored and davem330 committed Dec 9, 2014
1 parent 0f6538c commit bd42b78
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/sched/cls_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bd42b78

Please sign in to comment.