[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250729133828.GE1877762@horms.kernel.org>
Date: Tue, 29 Jul 2025 14:38:28 +0100
From: Simon Horman <horms@...nel.org>
To: Tian <27392025k@...il.com>
Cc: irusskikh@...vell.com, netdev@...r.kernel.org, andrew+netdev@...n.ch,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v2] net: atlantic: fix overwritten return value in
Aquantia driver
On Mon, Jul 28, 2025 at 05:58:52PM -0700, Tian wrote:
> From: Tian Liu <27392025k@...il.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@...il.com>
...
--
pw-bot: changes-requested
Powered by blists - more mailing lists