Skip to contentSkip to conversation

net_sched: check NULL on error path in route4_change()

PATCH In review Cong Wang 2 participants 2 messages Sep 18, 2016 – Sep 22, 2016

Subsystems (3)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

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()")
Cc Jamal Hadi Salim <[email protected]>
---
 net/sched/cls_route.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/sched/cls_route.c +2 -1
index c91e65d..aaab7a0 100644
@@ -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