From: Jay Vosburgh <jay.vosburgh@canonical.com>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: vfalico@gmail.com, andy@greyhouse.net, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH] bonding: return -ENOMEM on rlb_initialize() allocation failure
Date: Thu, 11 Aug 2022 20:29:48 -0700 [thread overview]
Message-ID: <1827.1660274988@famine> (raw)
In-Reply-To: <20220812032059.64572-1-jiapeng.chong@linux.alibaba.com>
Jiapeng Chong <jiapeng.chong@linux.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@linux.alibaba.com>
>Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.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@canonical.com
next prev parent reply other threads:[~2022-08-12 3:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-12 3:20 [PATCH] bonding: return -ENOMEM on rlb_initialize() allocation failure Jiapeng Chong
2022-08-12 3:29 ` Jay Vosburgh [this message]
2022-08-12 7:14 ` Christophe JAILLET
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1827.1660274988@famine \
--to=jay.vosburgh@canonical.com \
--cc=abaci@linux.alibaba.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vfalico@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).