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]
Message-ID: <1827.1660274988@famine>
Date:   Thu, 11 Aug 2022 20:29:48 -0700
From:   Jay Vosburgh <jay.vosburgh@...onical.com>
To:     Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
cc:     vfalico@...il.com, andy@...yhouse.net, davem@...emloft.net,
        edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Abaci Robot <abaci@...ux.alibaba.com>
Subject: Re: [PATCH] bonding: return -ENOMEM on rlb_initialize() allocation failure

Jiapeng Chong <jiapeng.chong@...ux.alibaba.com> wrote:

>drivers/net/bonding/bond_alb.c:861 rlb_initialize() warn: returning -1 instead of -ENOMEM is sloppy.

	I'll disagree; the return value is only ever tested for being
non-zero.

	-J

>Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1896
>Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
>Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
>---
> drivers/net/bonding/bond_alb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
>index 60cb9a0225aa..96cb4404b3c7 100644
>--- a/drivers/net/bonding/bond_alb.c
>+++ b/drivers/net/bonding/bond_alb.c
>@@ -858,7 +858,7 @@ static int rlb_initialize(struct bonding *bond)
> 
> 	new_hashtbl = kmalloc(size, GFP_KERNEL);
> 	if (!new_hashtbl)
>-		return -1;
>+		return -ENOMEM;
> 
> 	spin_lock_bh(&bond->mode_lock);
> 
>-- 
>2.20.1.7.g153144c
>

---
	-Jay Vosburgh, jay.vosburgh@...onical.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ