Skip to contentSkip to conversation

net: sched: fix possible null pointer deref in tcf_block_put

PATCH Applied Jiri Pirko 2 participants 2 messages Dec 21, 2017 – Dec 26, 2017

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author maintainer
#0 lore raw

PATCH 1/1 net: sched: fix possible null pointer deref in tcf_block_put

From: Jiri Pirko <[email protected]>

We need to check block for being null in both tcf_block_put and tcf_block_put_ext.

Fixes 343723dd51ef ("net: sched: fix clsact init error path")
---
 net/sched/cls_api.c | 2 ++
 1 file changed, 2 insertions(+)
net/sched/cls_api.c +2 -0
index b91ea03..b9d63d2 100644
@@ -379,6 +379,8 @@ void tcf_block_put(struct tcf_block *block)
 {
 	struct tcf_block_ext_info ei = {0, };
 
+	if (!block)
+		return;
 	tcf_block_put_ext(block, block->q, &ei);
 }
 
Signature · 1 line
2.9.5