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]
Date:   Sun, 19 Feb 2023 11:48:17 +0200
From:   Leon Romanovsky <leon@...nel.org>
To:     Maxim Korotkov <korotkov.maxim.s@...il.com>
Cc:     Rasesh Mody <rmody@...vell.com>, GR-Linux-NIC-Dev@...vell.com,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Michael Chan <mchan@...adcom.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, lvc-project@...uxtesting.org
Subject: Re: [PATCH] bnx2: remove deadcode in bnx2_init_cpus()

On Sat, Feb 18, 2023 at 04:00:16PM +0300, Maxim Korotkov wrote:
> The load_cpu_fw function has no error return code
> and always returns zero. Checking the value returned by
> this function does not make sense.
> As a result, bnx2_init_cpus will also return only zero
> 
> Found by Security Code and Linux Verification
> Center (linuxtesting.org) with SVACE
> 
> Fixes: 57579f7629a3 ("bnx2: Use request_firmware()")
> Signed-off-by: Maxim Korotkov <korotkov.maxim.s@...il.com>
> ---
>  drivers/net/ethernet/broadcom/bnx2.c | 22 ++++++----------------
>  1 file changed, 6 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
> index 9f473854b0f4..4dacb65a7348 100644
> --- a/drivers/net/ethernet/broadcom/bnx2.c
> +++ b/drivers/net/ethernet/broadcom/bnx2.c
> @@ -3908,37 +3908,27 @@ bnx2_init_cpus(struct bnx2 *bp)
>  		(const struct bnx2_mips_fw_file *) bp->mips_firmware->data;
>  	const struct bnx2_rv2p_fw_file *rv2p_fw =
>  		(const struct bnx2_rv2p_fw_file *) bp->rv2p_firmware->data;
> -	int rc;
>  
>  	/* Initialize the RV2P processor. */
>  	load_rv2p_fw(bp, RV2P_PROC1, &rv2p_fw->proc1);
>  	load_rv2p_fw(bp, RV2P_PROC2, &rv2p_fw->proc2);
>  
>  	/* Initialize the RX Processor. */
> -	rc = load_cpu_fw(bp, &cpu_reg_rxp, &mips_fw->rxp);
> -	if (rc)
> -		goto init_cpu_err;
> +	(void)load_cpu_fw(bp, &cpu_reg_rxp, &mips_fw->rxp);

Please don't cast return types to void. It is useless.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ