Commit 7052622f authored by Dan Carpenter's avatar Dan Carpenter Committed by Jakub Kicinski

netfilter: nft_socket: Fix a NULL vs IS_ERR() bug in nft_socket_cgroup_subtree_level()

The cgroup_get_from_path() function never returns NULL, it returns error
pointers.  Update the error handling to match.

Fixes: 7f3287db ("netfilter: nft_socket: make cgroupsv2 matching work with namespaces")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Acked-by: default avatarFlorian Westphal <fw@strlen.de>
Acked-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Link: https://patch.msgid.link/bbc0c4e0-05cc-4f44-8797-2f4b3920a820@stanley.mountainSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 36f6b72c
...@@ -61,8 +61,8 @@ static noinline int nft_socket_cgroup_subtree_level(void) ...@@ -61,8 +61,8 @@ static noinline int nft_socket_cgroup_subtree_level(void)
struct cgroup *cgrp = cgroup_get_from_path("/"); struct cgroup *cgrp = cgroup_get_from_path("/");
int level; int level;
if (!cgrp) if (IS_ERR(cgrp))
return -ENOENT; return PTR_ERR(cgrp);
level = cgrp->level; level = cgrp->level;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment