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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 27 Aug 2010 07:54:44 +0300
From:	"Eilon Greenstein" <eilong@...adcom.com>
To:	"Eric Dumazet" <eric.dumazet@...il.com>
cc:	"David Miller" <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>,
	"Vladislav Zolotarov" <vladz@...adcom.com>
Subject: Re: [PATCH] bnx2x: fix wrong return from bnx2x_trylock_hw_lock

On Thu, 2010-08-26 at 20:49 -0700, Eric Dumazet wrote:
> bnx2x_trylock_hw_lock() returns a bool :
> 
> true if succeeded to acquire the lock.
> false in case of error.
> 
> -EINVAL is not an acceptable value, since its promoted to true.

Indeed - thanks Eric!

> Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
Acked-by: Eilon Greenstein <eilong@...adcom.com>

> ---
> Cosmetic patch, since compiler probably omits the code anyway.
> 
> diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
> index f8c3f08..86cc4b0 100644
> --- a/drivers/net/bnx2x/bnx2x_main.c
> +++ b/drivers/net/bnx2x/bnx2x_main.c
> @@ -781,7 +781,7 @@ static bool bnx2x_trylock_hw_lock(struct bnx2x *bp, u32 resource)
>  		DP(NETIF_MSG_HW,
>  		   "resource(0x%x) > HW_LOCK_MAX_RESOURCE_VALUE(0x%x)\n",
>  		   resource, HW_LOCK_MAX_RESOURCE_VALUE);
> -		return -EINVAL;
> +		return false;
>  	}
>  
>  	if (func <= 5)
> 
> 
> 



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ