cgroup: Make cgroup_get_from_id() prettier
authorTejun Heo <tj@kernel.org>
Fri, 23 Sep 2022 17:23:06 +0000 (07:23 -1000)
committerTejun Heo <tj@kernel.org>
Fri, 23 Sep 2022 17:23:06 +0000 (07:23 -1000)
commit7e1eb5437d3c3fdb61d45378579aab383cafc694
tree9c8dea280ca0cf8a19a95c62e0de8931e0305752
parent026e14a276c67c8433ecb10e557f0ba23d2b6636
cgroup: Make cgroup_get_from_id() prettier

After merging 836ac87d ("cgroup: fix cgroup_get_from_id") into for-6.1, its
combination with two commits in for-6.1 - 4534dee9 ("cgroup: cgroup: Honor
caller's cgroup NS when resolving cgroup id") and fa7e439c ("cgroup:
Homogenize cgroup_get_from_id() return value") - makes the gotos in the
error handling path too ugly while not adding anything of value.

All that the gotos are saving is one extra kernfs_put() call. Let's remove
the gotos and perform error returns directly.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Michal Koutný <mkoutny@suse.com>
kernel/cgroup/cgroup.c