public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Tian <27392025k@gmail.com>
Cc: irusskikh@marvell.com, netdev@vger.kernel.org,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] net: atlantic: fix overwritten return value in Aquantia driver
Date: Tue, 29 Jul 2025 14:38:28 +0100	[thread overview]
Message-ID: <20250729133828.GE1877762@horms.kernel.org> (raw)
In-Reply-To: <20250729005853.33130-1-27392025k@gmail.com>

On Mon, Jul 28, 2025 at 05:58:52PM -0700, Tian wrote:
> From: Tian Liu <27392025k@gmail.com>
> 
> In hw_atl_utils.c and hw_atl_utils_fw2x.c, a return value is first assigned
> to `err`, but then later calls overwrite it unconditionally. As a result,
> any earlier failure is lost if the later call succeeds. This may cause the
> driver to proceed when it should have stopped.
> 
> This patch uses `err |=` instead of assignment, so that any earlier error
> is preserved even if later calls succeed. This is safe because all involved
> functions return standard negative error codes (e.g. -EIO, -ETIMEDOUT, etc).
> OR-ing such values does not convert them into success, and preserves the
> indication that an error occurred.
> 
> Fixes: 6a7f2277313b4 ("net: aquantia: replace AQ_HW_WAIT_FOR with readx_poll_timeout_atomic")

nit: No blank line here

I do agree that the Fixes tag is correct in the case of hw_atl_utils_fw2x.c

But, in the case of hw_atl_utils.c, it seems to me that the correct Fixes
tag would be as follows, because prior to this commit the value of err was
not overwritten:

Fixes: e7b5f97e6574 ("net: atlantic: check rpc result and wait for rpc address")

Given the different commits that are being fixed I would suggest splitting
the patch into two, one per file that is being updated.

> 
> Signed-off-by: Tian Liu <27392025k@gmail.com>

...

-- 
pw-bot: changes-requested

  parent reply	other threads:[~2025-07-29 13:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29  0:58 [PATCH net v2] net: atlantic: fix overwritten return value in Aquantia driver Tian
2025-07-29  1:39 ` Andrew Lunn
2025-07-29 13:28   ` Simon Horman
2025-07-29 13:38 ` Simon Horman [this message]
2025-07-29 15:06 ` Markus Elfring

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=20250729133828.GE1877762@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=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