]> git.baikalelectronics.ru Git - kernel.git/commit
cgroup: fix idr leak for the first cgroup root
authorJohannes Weiner <hannes@cmpxchg.org>
Fri, 17 Jun 2016 16:23:59 +0000 (12:23 -0400)
committerTejun Heo <tj@kernel.org>
Fri, 17 Jun 2016 18:16:28 +0000 (14:16 -0400)
commit96f7274ec34a8748ab96d7bd10c31d858eb4390e
tree8d9c0a06d651b1b6429d8a4968570c0b0013115f
parent10e61ccbce8e2b894f1a1d40e8bf8fa3a1578e1a
cgroup: fix idr leak for the first cgroup root

The valid cgroup hierarchy ID range includes 0, so we can't filter for
positive numbers when freeing it, or it'll leak the first ID. No big
deal, just disruptive when reading the code.

The ID is freed during error handling and when the reference count
hits zero, so the double-free test is not necessary; remove it.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup.c