diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2016-09-19 00:52:20 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-23 12:51:49 +0200 |
commit | 21641c2e1ffd0b504610a33beaeab8fcc5140677 (patch) | |
tree | 7d85de3b3d90be1949715ff6f542dc3888041022 /net/sched/cls_route.c | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff) | |
download | linux-21641c2e1ffd0b504610a33beaeab8fcc5140677.tar.xz linux-21641c2e1ffd0b504610a33beaeab8fcc5140677.zip |
net_sched: check NULL on error path in route4_change()
On error path in route4_change(), 'f' could be NULL,
so we should check NULL before calling tcf_exts_destroy().
Fixes: b9a24bb76bf6 ("net_sched: properly handle failure case of tcf_exts_init()")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_route.c')
-rw-r--r-- | net/sched/cls_route.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index a4ce39b19be0..455fc8f83d0a 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c @@ -559,7 +559,8 @@ static int route4_change(struct net *net, struct sk_buff *in_skb, return 0; errout: - tcf_exts_destroy(&f->exts); + if (f) + tcf_exts_destroy(&f->exts); kfree(f); return err; } |