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>] [day] [month] [year] [list]
Message-ID: <CY1PR11MB082858B2B8153DF1BF51FF848AB10@CY1PR11MB0828.namprd11.prod.outlook.com>
Date:	Mon, 7 Mar 2016 14:51:13 +0000
From:	Ariel Elior <Ariel.Elior@...gic.com>
To:	Nicholas Krause <xerofoify@...il.com>
CC:	netdev <netdev@...r.kernel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 2/2] bnx2x:Fix error handling for functions in
 bnx2x_link.c

> -----Original Message-----
> From: Nicholas Krause [mailto:xerofoify@...il.com]
> Sent: Monday, March 07, 2016 4:12 AM
> To: Ariel Elior <Ariel.Elior@...gic.com>
> Cc: netdev <netdev@...r.kernel.org>; linux-kernel <linux-kernel@...r.kernel.org>
> Subject: [PATCH 2/2] bnx2x:Fix error handling for functions in bnx2x_link.c
> 
> This fixes various functions that call the function
> bnx2x_84833_get_reset_gpios to properly check if this
> function has returned a error code and if so return
> immediately with the error code to signal these function's
> 
> Signed-off-by: Nicholas Krause <xerofoify@...il.com>
> ---
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
> index a0b03c2..b0646d9 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
> @@ -10079,6 +10079,7 @@ static int bnx2x_84833_hw_reset_phy(struct bnx2x_phy
> *phy,
>  {
>  	struct bnx2x *bp = params->bp;
>  	u8 reset_gpios;
> +	int rc;
>  	u32 other_shmem_base_addr = REG_RD(bp, params->shmem2_base +
>  				offsetof(struct shmem2_region,
>  				other_shmem_base_addr));
> @@ -10099,7 +10100,12 @@ static int bnx2x_84833_hw_reset_phy(struct bnx2x_phy
> *phy,
>  	reset_gpios = bnx2x_84833_get_reset_gpios(bp, shmem_base_path,
>  						  params->chip_id);
> 
> -	bnx2x_set_mult_gpio(bp, reset_gpios,
> MISC_REGISTERS_GPIO_OUTPUT_LOW);
> +	rc = bnx2x_set_mult_gpio(bp, reset_gpios,
> MISC_REGISTERS_GPIO_OUTPUT_LOW);
> +	if (rc) {
> +		DP(NETIF_MSG_LINK, "84833 hw reset on pin values 0x%x\n failed ",
> +		   reset_gpios);
> +		return rc;
> +	}
>  	udelay(10);
>  	DP(NETIF_MSG_LINK, "84833 hw reset on pin values 0x%x\n",
>  		reset_gpios);
> @@ -13242,10 +13248,21 @@ static int bnx2x_84833_common_init_phy(struct
> bnx2x *bp,
>  						u32 chip_id)
>  {
>  	u8 reset_gpios;
> +	int ret;
>  	reset_gpios = bnx2x_84833_get_reset_gpios(bp, shmem_base_path, chip_id);
> -	bnx2x_set_mult_gpio(bp, reset_gpios,
> MISC_REGISTERS_GPIO_OUTPUT_LOW);
> +	ret = bnx2x_set_mult_gpio(bp, reset_gpios,
> MISC_REGISTERS_GPIO_OUTPUT_LOW);
> +	if (ret) {
> +		DP(NETIF_MSG_LINK, "84833 reset pulse on pin values 0x%x\n",
> +		   reset_gpios);
> +		return ret;
> +	}
>  	udelay(10);
> -	bnx2x_set_mult_gpio(bp, reset_gpios,
> MISC_REGISTERS_GPIO_OUTPUT_HIGH);
> +	ret = bnx2x_set_mult_gpio(bp, reset_gpios,
> MISC_REGISTERS_GPIO_OUTPUT_HIGH);
> +	if (ret) {
> +		DP(NETIF_MSG_LINK, "84833 reset pulse on pin values 0x%x\n",
> +		   reset_gpios);
> +		return ret;
> +	}
>  	DP(NETIF_MSG_LINK, "84833 reset pulse on pin values 0x%x\n",
>  		reset_gpios);
>  	return 0;
> --
> 2.1.4
Thanks Nicholas.
Acked-by: Ariel Elior <ariel.elior@...gic.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ