diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-09-29 23:30:51 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-09-29 23:30:51 +0200 |
commit | accc3b4a572bba903a801a393532272727f83f5b (patch) | |
tree | b6677755ec43793d5719246f51e27f0e9d12b6c0 /kernel/cgroup | |
parent | net: cpmac: Add __init/__exit annotations to module init/exit funcs (diff) | |
parent | Merge tag 'net-6.0-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netd... (diff) | |
download | linux-accc3b4a572bba903a801a393532272727f83f5b.tar.xz linux-accc3b4a572bba903a801a393532272727f83f5b.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
No conflicts.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'kernel/cgroup')
-rw-r--r-- | kernel/cgroup/cgroup.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 2ddae5743d53..8ad2c267ff47 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -6049,6 +6049,9 @@ struct cgroup *cgroup_get_from_id(u64 id) if (!kn) goto out; + if (kernfs_type(kn) != KERNFS_DIR) + goto put; + rcu_read_lock(); cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv); @@ -6056,7 +6059,7 @@ struct cgroup *cgroup_get_from_id(u64 id) cgrp = NULL; rcu_read_unlock(); - +put: kernfs_put(kn); out: return cgrp; |