bnx2x:Fix error handling for the function bnx2x_set_mutl_gpio
Subsystems (2)
Ariel Elior
Acked-byQuoted 34 lines
-----Original Message-----
From: Nicholas Krause [mailto:[email protected]]
Sent: Monday, March 07, 2016 4:05 AM
To: Ariel Elior <[email protected]>
Cc: netdev <[email protected]>; linux-kernel <[email protected]>
Subject: [PATCH 1/2] bnx2x:Fix error handling for the functionbnx2x_set_mutl_gpioThis fixes the error handling for the function
bnx2x_set_mutl_gpiofor checking if the functionbnx2x_acquire_hw_lockran successfully by not returning a error code and if it does return the error code to this function's caller in addition to exiting from this function immediately due to this failure.Signed-off-by Nicholas Krause <[email protected]>--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +3
-1@@ -2151,7 +2151,9 @@ int bnx2x_set_mult_gpio(struct bnx2x *bp, u8 pins, u32 mode)/* Any port swapping should be handled by caller. */ -bnx2x_acquire_hw_lock (bp ,HW_LOCK_RESOURCE_GPIO ); + rc =bnx2x_acquire_hw_lock (bp,HW_LOCK_RESOURCE_GPIO ); +if (rc) +return rc;/* read GPIO and mask except the float bits */ gpio_reg =REG_RD (bp,MISC_REG_GPIO );
Quoted 3 lines
gpio_reg&= ~(pins <<MISC_REGISTERS_GPIO_FLOAT_POS);
--
2.1.4
Thanks Nicholas.
Acked-by Ariel Elior <[email protected]>