summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-08-03 21:27:55 +0200
committerDavid S. Miller <davem@davemloft.net>2018-08-06 02:25:46 +0200
commit1cbc36a53b60d43daa686280385b1ddbe51d5809 (patch)
treeadfdb3fc156c6637821afc9c2705e23e1fcd4c15 /net/sched
parentnet: check extack._msg before print (diff)
downloadlinux-1cbc36a53b60d43daa686280385b1ddbe51d5809.tar.xz
linux-1cbc36a53b60d43daa686280385b1ddbe51d5809.zip
net: sched: cls_flower: Fix an error code in fl_tmplt_create()
We forgot to set the error code on this path, so we return NULL instead of an error pointer. In the current code kzalloc() won't fail for small allocations so this doesn't really affect runtime. Fixes: b95ec7eb3b4d ("net: sched: cls_flower: implement chain templates") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/cls_flower.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index e8bd08ba998a..a3b69bb6f4b0 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -1250,8 +1250,10 @@ static void *fl_tmplt_create(struct net *net, struct tcf_chain *chain,
goto errout_tb;
tmplt = kzalloc(sizeof(*tmplt), GFP_KERNEL);
- if (!tmplt)
+ if (!tmplt) {
+ err = -ENOMEM;
goto errout_tb;
+ }
tmplt->chain = chain;
err = fl_set_key(net, tb, &tmplt->dummy_key, &tmplt->mask, extack);
if (err)