mirror of
https://github.com/torvalds/linux.git
synced 2024-10-22 21:20:52 +00:00
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: 7f3287db65
("netfilter: nft_socket: make cgroupsv2 matching work with namespaces")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Florian Westphal <fw@strlen.de>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Link: https://patch.msgid.link/bbc0c4e0-05cc-4f44-8797-2f4b3920a820@stanley.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
36f6b72cb8
commit
7052622fcc
|
@ -61,8 +61,8 @@ static noinline int nft_socket_cgroup_subtree_level(void)
|
|||
struct cgroup *cgrp = cgroup_get_from_path("/");
|
||||
int level;
|
||||
|
||||
if (!cgrp)
|
||||
return -ENOENT;
|
||||
if (IS_ERR(cgrp))
|
||||
return PTR_ERR(cgrp);
|
||||
|
||||
level = cgrp->level;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user