Re: [PATCH net v2] net: atlantic: fix overwritten return value in Aquantia driver

From: Simon Horman
Date: Tue Jul 29 2025 - 09:39:09 EST


On Mon, Jul 28, 2025 at 05:58:52PM -0700, Tian wrote:
> From: Tian Liu <27392025k@xxxxxxxxx>
>
> 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@xxxxxxxxx>

...

--
pw-bot: changes-requested