lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240930182401.3dd15aaa@bootlin.com>
Date: Mon, 30 Sep 2024 18:24:01 +0200
From: Herve Codina <herve.codina@...tlin.com>
To: Geert Uytterhoeven <geert+renesas@...der.be>
Cc: Qiang Zhao <qiang.zhao@....com>, Christophe Leroy
 <christophe.leroy@...roup.eu>, linuxppc-dev@...ts.ozlabs.org,
 linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] soc: fsl: cpm1: qmc: Do not use IS_ERR_VALUE() on error
 pointers

Hi Geert,

On Mon, 30 Sep 2024 17:08:31 +0200
Geert Uytterhoeven <geert+renesas@...der.be> wrote:

> ppc64_book3e_allmodconfig:
> 
>     drivers/soc/fsl/qe/qmc.c: In function ‘qmc_qe_init_resources’:
>     include/linux/err.h:28:49: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>        28 | #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
> 	  |                                                 ^
>     include/linux/compiler.h:77:45: note: in definition of macro ‘unlikely’
>        77 | # define unlikely(x)    __builtin_expect(!!(x), 0)
> 	  |                                             ^
>     drivers/soc/fsl/qe/qmc.c:1764:13: note: in expansion of macro ‘IS_ERR_VALUE’
>      1764 |         if (IS_ERR_VALUE(info)) {
> 	  |             ^~~~~~~~~~~~
> 
> IS_ERR_VALUE() is only meant for pointers.  Fix this by checking for a
> negative error value instead, which matches the documented behavior of
> devm_qe_muram_alloc() aka devm_cpm_muram_alloc().
> While at it, remove the unneeded print in case of a memory allocation
> failure, and propagate the returned error code.
> 
> Fixes: eb680d563089e55b ("soc: fsl: cpm1: qmc: Add support for QUICC Engine (QE) implementation")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
> ---
> Compile-tested only.
> ---
>  drivers/soc/fsl/qe/qmc.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 

Thanks for the patch.
Works on my side, no regressions found on my MPC8321 system.
Tested-by: Herve Codina <herve.codina@...tlin.com>

And of course:
Acked-by: Herve Codina <herve.codina@...tlin.com>

Sorry for this mistake.
Best regards,
Hervé

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ