1
0
Fork 0

net: sched: fix block->refcnt decrement

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.

Reported-by: Vlad Buslov <vladbu@mellanox.com>
Fixes: f71e0ca4db ("net: sched: Avoid implicit chain 0 creation")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
hifive-unleashed-5.1
Jiri Pirko 2018-08-08 14:04:13 +02:00 committed by David S. Miller
parent 0bab1cdc8c
commit 63cc5bcc9f
1 changed files with 2 additions and 0 deletions

View File

@ -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);