net_sched: check NULL on error path in route4_change()
Subsystems (3)
PATCH 1/1 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 <[email protected]>
Cc Jamal Hadi Salim <[email protected]>
Signed-off-by Cong Wang <[email protected]>
--- net/sched/cls_route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sched/cls_route.c +2 -1
@@ -562,7 +562,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; }
Signature · 1 line
2.1.0
Quoted 7 lines · Cong Wang
On error path in
route4_change(), 'f' could be NULL, so we should check NULL before callingtcf_exts_destroy().Fixes b9a24bb76bf6 ("net_sched: properly handle failure case of tcf_exts_init()")Reported-by kbuild test robot <[email protected]>Cc Jamal Hadi Salim <[email protected]>Signed-off-by Cong Wang <[email protected]>
Acked-by Jamal Hadi Salim <[email protected]>
cheers,
jamal