Re: [PATCH] crypto: x509_loader: Use %pe to log error pointer
From: Herbert Xu
Date: Fri Nov 06 2026 - 06:32:27 EST
On Thu, Oct 15, 2026 at 04:15:00PM +0330, Muhammad Mahdi Amirpour wrote:
> The error path in x509_load_certificate_list() prints an error pointer
> with %ld and PTR_ERR(), which produces a raw errno value rather than
> the kernel's symbolic error name.
>
> Use %pe on the error pointer directly so the log reads:
>
> Problem loading in-kernel X.509 certificate (EINVAL)
>
> instead of:
>
> Problem loading in-kernel X.509 certificate (-22)
>
> The new form is easier to read and matches the convention used
> elsewhere in the kernel. Reported by Coccinelle's
> misc/ptr_err_to_pe.cocci semantic patch.
>
> Signed-off-by: Muhammad Mahdi Amirpour <ampr.mhd@xxxxxxxxx>
> ---
> crypto/asymmetric_keys/x509_loader.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt