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 <ash1…@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