From: Jay Vosburgh <jay.vosburgh@canonical.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Jonathan Toppins <jtoppins@redhat.com>,
Pavan Chebbi <pavan.chebbi@broadcom.com>,
Veaceslav Falico <vfalico@gmail.com>,
Andy Gospodarek <andy@greyhouse.net>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH net-next v2] bonding: uninitialized variable in bond_miimon_inspect()
Date: Mon, 28 Nov 2022 10:30:15 -0800 [thread overview]
Message-ID: <14024.1669660215@famine> (raw)
In-Reply-To: <Y4SWJlh3ohJ6EPTL@kili>
Dan Carpenter <error27@gmail.com> wrote:
>The "ignore_updelay" variable needs to be initialized to false.
>
>Fixes: f8a65ab2f3ff ("bonding: fix link recovery in mode 2 when updelay is nonzero")
>Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
>---
>v2: Re-order so the declarations are in reverse Christmas tree order
>
>Don't forget about:
>drivers/net/bonding/bond_main.c:5071 bond_update_slave_arr() warn: missing error code here? 'bond_3ad_get_active_agg_info()' failed. 'ret' = '0'
The code around the cited line is correct. A -1 return from
bond_3ad_get_active_agg_info is not indicative of an error in the sense
that something has failed, but indicates that there is no active
aggregator. The code correctly returns 0 from bond_update_slave_arr, as
returning non-zero would cause bond_slave_arr_handler to loop, retrying
the call to bond_update_slave_arr (via workqueue).
-J
> drivers/net/bonding/bond_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index c87481033995..e01bb0412f1c 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -2524,10 +2524,10 @@ static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *in
> /* called with rcu_read_lock() */
> static int bond_miimon_inspect(struct bonding *bond)
> {
>+ bool ignore_updelay = false;
> int link_state, commit = 0;
> struct list_head *iter;
> struct slave *slave;
>- bool ignore_updelay;
>
> if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) {
> ignore_updelay = !rcu_dereference(bond->curr_active_slave);
>--
>2.35.1
>
---
-Jay Vosburgh, jay.vosburgh@canonical.com
next prev parent reply other threads:[~2022-11-28 18:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-28 11:06 [PATCH net-next v2] bonding: uninitialized variable in bond_miimon_inspect() Dan Carpenter
2022-11-28 13:45 ` Pavan Chebbi
2022-11-28 14:36 ` Dan Carpenter
2022-11-28 14:40 ` Dan Carpenter
2022-11-28 15:05 ` Pavan Chebbi
2022-11-28 18:30 ` Jay Vosburgh [this message]
2022-11-29 12:51 ` Dan Carpenter
2022-12-01 10:20 ` patchwork-bot+netdevbpf
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=14024.1669660215@famine \
--to=jay.vosburgh@canonical.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=error27@gmail.com \
--cc=jtoppins@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.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).