Skip to content
Commit 8c8a5502 authored by Johannes Weiner's avatar Johannes Weiner Committed by Tejun Heo
Browse files

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: default avatarJohannes Weiner <hannes@cmpxchg.org>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent db06d759
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment