From: Tian <27392025k@gmail.com>
To: irusskikh@marvell.com, netdev@vger.kernel.org
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org,
tian <27392025k@gmail.com>
Subject: [PATCH] net: atlantic: fix overwritten return value in Aquantia driver
Date: Sun, 27 Jul 2025 16:17:50 -0700 [thread overview]
Message-ID: <20250727231750.25626-1-27392025k@gmail.com> (raw)
From: tian <27392025k@gmail.com>
In hw_atl_utils.c and hw_atl_utils_fw2x.c, a return value is set and then
immediately overwritten by another call, which causes the original result
to be lost. This may hide errors that should be returned to the caller.
This patch fixes the logic to preserve the intended return values.
Signed-off-by: tian <27392025k@gmail.com>
---
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c | 2 +-
.../net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
index 7e88d7234b14..372f30e296ec 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
@@ -492,7 +492,7 @@ static int hw_atl_utils_init_ucp(struct aq_hw_s *self,
self, self->mbox_addr,
self->mbox_addr != 0U,
1000U, 10000U);
- err = readx_poll_timeout_atomic(aq_fw1x_rpc_get, self,
+ err |= readx_poll_timeout_atomic(aq_fw1x_rpc_get, self,
self->rpc_addr,
self->rpc_addr != 0U,
1000U, 100000U);
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
index 4d4cfbc91e19..45b7720fd49e 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c
@@ -102,12 +102,12 @@ static int aq_fw2x_init(struct aq_hw_s *self)
self->mbox_addr != 0U,
1000U, 10000U);
- err = readx_poll_timeout_atomic(aq_fw2x_rpc_get,
+ err |= readx_poll_timeout_atomic(aq_fw2x_rpc_get,
self, self->rpc_addr,
self->rpc_addr != 0U,
1000U, 100000U);
- err = aq_fw2x_settings_get(self, &self->settings_addr);
+ err |= aq_fw2x_settings_get(self, &self->settings_addr);
return err;
}
--
2.39.5 (Apple Git-154)
next reply other threads:[~2025-07-27 23:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-27 23:17 Tian [this message]
2025-07-27 23:39 ` [PATCH] net: atlantic: fix overwritten return value in Aquantia driver Jason Xing
2025-07-28 2:49 ` Andrew Lunn
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=20250727231750.25626-1-27392025k@gmail.com \
--to=27392025k@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=irusskikh@marvell.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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