All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aswin Sreekumar <ash1994achu@gmail.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>, Florian Westphal <fw@strlen.de>
Cc: Phil Sutter <phil@nwl.cc>,
	netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	netdev@vger.kernel.org, Aswin Sreekumar <ash1994achu@gmail.com>
Subject: [PATCH net-next] netfilter: xt_cgroup: use %pe to print error pointer
Date: Mon, 30 Nov 2026 18:33:26 +0530	[thread overview]
Message-ID: <20261130130326.56204-1-ash1994achu@gmail.com> (raw)

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


                 reply	other threads:[~2026-11-30 13:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261130130326.56204-1-ash1994achu@gmail.com \
    --to=ash1994achu@gmail.com \
    --cc=coreteam@netfilter.org \
    --cc=fw@strlen.de \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=phil@nwl.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.