* [PATCH net-next] netfilter: xt_cgroup: use %pe to print error pointer
@ 2026-11-30 13:03 Aswin Sreekumar
0 siblings, 0 replies; only message in thread
From: Aswin Sreekumar @ 2026-11-30 13:03 UTC (permalink / raw)
To: Pablo Neira Ayuso, Florian Westphal
Cc: Phil Sutter, netfilter-devel, coreteam, netdev, Aswin Sreekumar
cgroup_mt_check_v1() and cgroup_mt_check_v2() log the failure from
cgroup_get_from_path() with %ld and PTR_ERR(). Switch to the %pe format
specifier and pass the error pointer directly. This prints the symbolic
error name (e.g. errno=-EINVAL instead of errno=-22) and drops the
explicit PTR_ERR() conversion.
Only the error message format changes; behaviour is otherwise unchanged.
Signed-off-by: Aswin Sreekumar <ash1994achu@gmail.com>
---
net/netfilter/xt_cgroup.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/netfilter/xt_cgroup.c b/net/netfilter/xt_cgroup.c
index 28e6cd51b..619b1eb4d 100644
--- a/net/netfilter/xt_cgroup.c
+++ b/net/netfilter/xt_cgroup.c
@@ -70,8 +70,7 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)
cgrp = cgroup_get_from_path(info->path);
if (IS_ERR(cgrp)) {
- pr_info_ratelimited("invalid path, errno=%ld\n",
- PTR_ERR(cgrp));
+ pr_info_ratelimited("invalid path, errno=%pe\n", cgrp);
return -EINVAL;
}
info->priv = cgrp;
@@ -110,8 +109,7 @@ static int cgroup_mt_check_v2(const struct xt_mtchk_param *par)
cgrp = cgroup_get_from_path(info->path);
if (IS_ERR(cgrp)) {
- pr_info_ratelimited("invalid path, errno=%ld\n",
- PTR_ERR(cgrp));
+ pr_info_ratelimited("invalid path, errno=%pe\n", cgrp);
return -EINVAL;
}
info->priv = cgrp;
--
2.56.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-30 13:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 13:03 [PATCH net-next] netfilter: xt_cgroup: use %pe to print error pointer Aswin Sreekumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox