All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch net-next] net: sched: fix block->refcnt decrement
@ 2018-08-08 12:04 Jiri Pirko
  2018-08-09 21:12 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Pirko @ 2018-08-08 12:04 UTC (permalink / raw)
  To: netdev; +Cc: davem, jhs, xiyou.wangcong, vladbu, mlxsw

From: Jiri Pirko <jiri@mellanox.com>

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: f71e0ca4db18 ("net: sched: Avoid implicit chain 0 creation")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 net/sched/cls_api.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 194c2e0b2737..f922ce27ed5e 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -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);
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch net-next] net: sched: fix block->refcnt decrement
  2018-08-08 12:04 [patch net-next] net: sched: fix block->refcnt decrement Jiri Pirko
@ 2018-08-09 21:12 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-08-09 21:12 UTC (permalink / raw)
  To: jiri; +Cc: netdev, jhs, xiyou.wangcong, vladbu, mlxsw

From: Jiri Pirko <jiri@resnulli.us>
Date: Wed,  8 Aug 2018 14:04:13 +0200

> From: Jiri Pirko <jiri@mellanox.com>
> 
> 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: f71e0ca4db18 ("net: sched: Avoid implicit chain 0 creation")
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-09 23:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-08 12:04 [patch net-next] net: sched: fix block->refcnt decrement Jiri Pirko
2018-08-09 21:12 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.