Skip to contentSkip to conversation

net: sched: fix block->refcnt decrement

PATCH Applied Jiri Pirko 2 participants 2 messages Aug 8, 2018 – Aug 9, 2018

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author maintainer
#0 lore raw

PATCH 1/1 net: sched: fix block->refcnt decrement

From: Jiri Pirko <[email protected]>

Currently the refcnt is never decremented in case the value is not 1. Fix it by adding decrement in case the refcnt is not 1.

Fixes f71e0ca4db18 ("net: sched: Avoid implicit chain 0 creation")
---
 net/sched/cls_api.c | 2 ++
 1 file changed, 2 insertions(+)
net/sched/cls_api.c +2 -0
index 194c2e0b2737..f922ce27ed5e 100644
@@ -780,6 +780,8 @@ void tcf_block_put_ext(struct tcf_block *block, struct Qdisc *q,
 		block->refcnt--;
 		if (list_empty(&block->chain_list))
 			kfree(block);
+	} else {
+		block->refcnt--;
 	}
 }
 EXPORT_SYMBOL(tcf_block_put_ext);
Signature · 1 line
2.14.4